/* AgriERP demo system. Design B · Corporate Enterprise colours from the proposal and PowerPoint demo. */
:root {
  --side: #0F2A4A; --side-txt: #E8EEF6; --side-mut: #9DB0C8; --side-act: #14A39A;
  --bg: #F3F6FA; --card: #fff; --line: #DFE5EE; --txt: #17222F; --mut: #66758A;
  --pri: #1D4F91; --pri-2: #163E73; --acc: #14A39A; --chip: #E8F1FB;
  --ok: #2E9E6B; --warn: #E39B2F; --bad: #D64545; --info: #2F7CD6;
  --r: 8px; --shadow: 0 1px 2px rgba(15, 42, 74, .06), 0 2px 8px rgba(15, 42, 74, .04);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Khmer", "Khmer UI", "Khmer OS Siemreap", "Khmer Sangam MN", Roboto, sans-serif;
  color: var(--txt); background: var(--bg); font-size: 14px; line-height: 1.45;
}
:lang(km) { line-height: 1.7; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.boot { padding: 40px; color: var(--mut); }
.mut { color: var(--mut); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g21 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g4 { grid-template-columns: 1fr; } }

/* ---------- app shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-txt); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 16px; color: #fff; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--side-mut); }
.side .grp { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--side-mut); padding: 14px 10px 4px; }
.side a { color: var(--side-txt); padding: 7px 10px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.side a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.side a.on { background: var(--side-act); color: #fff; }
.side .ic { width: 22px; text-align: center; flex: none; font-size: 14px; }
.side .top-link { justify-content: flex-start; gap: 8px; margin-top: 2px; }
.grp-box { margin-top: 2px; }
.grp-h { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--side-txt); font-size: 13.5px; }
.grp-h:hover { background: rgba(255, 255, 255, .07); } .grp-h:focus-visible { outline: 2px solid var(--side-act); }
.grp-box.cur > .grp-h { color: #fff; font-weight: 600; }
.chev { font-size: 11px; color: var(--side-mut); transition: transform .15s; }
.grp-box.open .chev { transform: rotate(90deg); }
.grp-box .sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .12); }
.grp-box.open .sub { display: flex; }
.grp-box .sub a { font-size: 13px; padding: 6px 10px; }
.side .badge { background: var(--warn); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.side .foot { margin-top: auto; padding: 14px 10px 4px; font-size: 11px; color: var(--side-mut); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 5; }
.top .crumb { color: var(--mut); font-size: 13px; }
.top .me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.content { padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; width: 100%; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 4px 0 20px rgba(0, 0, 0, .25); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; } .top { padding: 10px 16px; gap: 8px; }
}
@media (max-width: 640px) { .top .crumb { visibility: hidden; } .top .me .small { display: none; } }
.demo-strip { font-size: 11.5px; color: var(--mut); text-align: center; padding: 10px; border-top: 1px dashed var(--line); margin-top: auto; }

/* ---------- components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card > h2 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card > h2 a, .card > h2 .mut { font-size: 12.5px; font-weight: 400; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .lbl { color: var(--mut); font-size: 12.5px; }
.kpi .val { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--mut); }
.kpi.link { cursor: pointer; } .kpi.link:hover { border-color: var(--pri); }
.bar { height: 6px; background: var(--chip); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--acc); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--pri); background: var(--pri); color: #fff; border-radius: 6px;
  padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--pri-2); }
.btn.sec { background: #fff; color: var(--pri); } .btn.sec:hover { background: var(--chip); }
.btn.ok { background: var(--ok); border-color: var(--ok); } .btn.bad { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; } .btn.lg { padding: 12px 20px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--pri); white-space: nowrap; }
.pill.ok { background: #E3F4EC; color: #1F7A50; } .pill.warn { background: #FCF0DC; color: #9A6212; }
.pill.bad { background: #FBE6E6; color: #A83232; } .pill.info { background: #E5EFFB; color: #245FA6; } .pill.mut { background: #EEF1F5; color: var(--mut); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--mut); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #F8FAFC; }
table.t td { padding: 8px 10px; border-bottom: 1px solid #EEF1F5; vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #F5F9FF; }
.tw { overflow-x: auto; margin: 0 -16px -16px; } .tw table.t th:first-child, .tw table.t td:first-child { padding-left: 16px; }
.alert { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #EEF1F5; align-items: flex-start; }
.alert:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--info); }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.ok { background: var(--ok); }
.empty { color: var(--mut); padding: 18px; text-align: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: -4px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--mut); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--pri); border-color: var(--pri); font-weight: 600; } .tabs a:hover { text-decoration: none; color: var(--pri); }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-h p { margin: 4px 0 0; color: var(--mut); }
.result { border-left: 4px solid var(--ok); background: #F1FAF5; padding: 12px 14px; border-radius: 6px; }
.result.warn { border-color: var(--warn); background: #FFF8EC; }
.lv { height: 10px; border-radius: 5px; background: #EEF1F5; overflow: hidden; } .lv > i { display: block; height: 100%; background: var(--info); }

/* ---------- forms */
form.f { display: grid; gap: 12px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
label.l { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--mut); font-weight: 600; }
label.l.wide { grid-column: 1 / -1; }
input, select, textarea { font: inherit; color: var(--txt); padding: 8px 10px; border: 1px solid #C9D3E0; border-radius: 6px; background: #fff; width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29, 79, 145, .25); border-color: var(--pri); }
textarea { min-height: 90px; resize: vertical; }
.err { color: var(--bad); font-size: 13px; min-height: 0; }
.err:empty { display: none; }

/* ---------- toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #17222F; color: #fff; padding: 10px 18px; border-radius: 8px;
  opacity: 0; transition: all .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%); } #toast.bad { background: var(--bad); }

/* ---------- charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-size: 11px; fill: var(--mut); }
svg.chart .v { fill: var(--txt); font-weight: 600; }

/* ---------- public website */
.web-top { background: var(--side); color: #fff; }
.web-top .in, .web-sec .in, .web-foot .in { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.web-nav { display: flex; align-items: center; gap: 22px; padding: 14px 0; flex-wrap: wrap; }
.web-nav a { color: #DCE6F2; } .web-nav a.on { color: #fff; font-weight: 600; border-bottom: 2px solid var(--acc); }
.web-nav .brand { padding: 0; margin-right: auto; }
.hero { padding: 56px 0 64px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 38px; line-height: 1.15; }
.hero p { color: #C9D6E6; font-size: 16px; }
.hero .panel { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 20px; display: grid; gap: 12px; }
.hero .panel .val { font-size: 28px; font-weight: 600; } .hero .panel .lbl { color: #9DB0C8; font-size: 13px; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; padding: 32px 0; } .hero h1 { font-size: 28px; } }
.web-sec { padding: 40px 0; } .web-sec h2 { font-size: 22px; margin-bottom: 16px; }
.web-foot { background: #0B1F38; color: #9DB0C8; padding: 22px 0; font-size: 12.5px; }
.post h3 { font-size: 16px; margin-bottom: 4px; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 420px 1fr; }
.login-side { background: var(--side); color: #fff; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.login-main { padding: 40px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.acct { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.acct:hover { border-color: var(--pri); }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-side, .login-main { padding: 24px; } }

/* ---------- farm owner mobile app */
.phone { max-width: 460px; margin: 0 auto; min-height: 100vh; background: #F4F7F2; display: flex; flex-direction: column; box-shadow: 0 0 30px rgba(0, 0, 0, .08); }
.phone-top { background: #2F6B3A; color: #fff; padding: 16px 18px 20px; }
.phone-top .row { justify-content: space-between; }
.phone-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.phone .card { border-radius: 14px; }
.big-num { font-size: 40px; font-weight: 700; color: #2F6B3A; font-variant-numeric: tabular-nums; }
.phone .btn { background: #2F6B3A; border-color: #2F6B3A; border-radius: 12px; }
.phone .btn.sec { background: #fff; color: #2F6B3A; }
.phone input { font-size: 20px; padding: 12px; }
.phone label.l { font-size: 15px; color: var(--txt); }
.lang-sw { display: inline-flex; border: 1px solid rgba(255, 255, 255, .4); border-radius: 14px; overflow: hidden; font-size: 12px; }
.lang-sw a { color: inherit; padding: 2px 10px; } .lang-sw a.on { background: rgba(255, 255, 255, .25); }
.top .lang-sw { border-color: var(--line); } .top .lang-sw a { color: var(--mut); } .top .lang-sw a.on { background: var(--chip); color: var(--pri); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper button { font-size: 24px; border-radius: 12px; border: 1px solid #C9D3E0; background: #fff; cursor: pointer; }
.stepper input { text-align: center; }

/* ---------- customer portal */
.portal-top { background: #fff; border-bottom: 1px solid var(--line); }
.portal-top .in { max-width: 1000px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.portal-body { max-width: 1000px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Smart Farm Assistant */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.steps a { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; padding: 8px 0; border-top: 3px solid var(--line); }
.steps a span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--mut); font-weight: 600; font-size: 12px; flex: none; }
.steps a.on { color: var(--pri); font-weight: 600; border-color: var(--pri); } .steps a.on span { background: var(--pri); color: #fff; }
.steps a.done { border-color: var(--ok); } .steps a.done span { background: var(--ok); color: #fff; }
.steps a:hover { text-decoration: none; }
@media (max-width: 800px) { .steps { grid-template-columns: repeat(5, auto); } .steps a { font-size: 0; } }
.choice { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.on { border: 2px solid var(--pri); background: var(--chip); }
ul.ticks { list-style: none; padding: 0; margin: 0; } ul.ticks li { padding: 5px 0; } ul.ticks li::before { content: '✓  '; color: var(--ok); font-weight: 700; }

/* ---------- notifications */
.bell-wrap { position: relative; }
.bell { position: relative; width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }
.bell:hover, .bell[aria-expanded="true"] { background: var(--chip); border-color: var(--pri); }
.bell-n { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 19px; border: 2px solid #fff; }
.bell-n[hidden] { display: none; }
.notif { position: absolute; right: 0; top: 44px; width: 390px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 42, 74, .18); z-index: 40; overflow: hidden; display: flex; flex-direction: column; max-height: min(75vh, 640px); }
.notif[hidden] { display: none; }
.notif-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-h .x { border: 0; background: none; font-size: 15px; cursor: pointer; color: var(--mut); }
.notif-b { overflow-y: auto; padding: 4px 12px 12px; }
.notif-f { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line); font-weight: 600; }
.n-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); font-weight: 600; margin: 12px 4px 6px; }
.n-it { display: flex; gap: 10px; padding: 9px 8px; border-radius: 8px; color: var(--txt); align-items: flex-start; }
.n-it:hover { background: #F5F8FC; text-decoration: none; }
.n-it.new { background: #F2F7FF; } .n-it.new b::after { content: ' •'; color: var(--info); }
.ap { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 3px; background: #fff; }
.ap.done { background: #F6FBF8; }
.ap-act, .ap-rej { display: flex; gap: 8px; margin-top: 6px; } .ap-rej[hidden] { display: none; } .ap-rej input { padding: 5px 8px; }
.ap-act .btn { flex: 1; }

/* ---------- donut */
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut .legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.donut .legend > div { display: flex; align-items: center; gap: 8px; } .donut .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut .pct { min-width: 34px; text-align: right; }

/* ---------- mobile bottom tabs and drawer */
.m-tabs { display: none; } .m-only { display: none; }
@media (max-width: 760px) {
  .m-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
  .m-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--mut); text-decoration: none !important; }
  .m-tabs a.on { color: var(--pri); font-weight: 600; }
  .m-tabs .ti { font-size: 19px; position: relative; line-height: 1.2; }
  .m-tabs .ti i { position: absolute; top: -4px; right: -12px; background: var(--bad); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
  .main { padding-bottom: 64px; }
  .top .so, .top .lang-sw { display: none; } .m-only { display: inline-flex; margin-bottom: 8px; }
  .side .foot { display: flex; flex-direction: column; align-items: flex-start; }
  .notif { position: fixed; left: 12px; right: 12px; top: 58px; width: auto; max-width: none; }
}

/* ---------- mobile company dashboard */
.m-dash { display: flex; flex-direction: column; gap: 14px; margin: -16px -16px 0; }
.m-hero { background: linear-gradient(135deg, #0F2A4A 0%, #1D4F91 60%, #14A39A 140%); color: #fff; padding: 18px 18px 20px; border-radius: 0 0 22px 22px; }
.m-hero .m-sub { font-size: 12.5px; opacity: .8; } .m-hero .m-name { font-size: 20px; font-weight: 700; margin: 2px 0; }
.m-hero-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.m-big { font-size: 32px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.m-hero .spark { margin-top: 8px; max-width: 180px; display: block; }
.live { font-size: 11px; background: rgba(255, 255, 255, .14); padding: 3px 9px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #6EF2B0; box-shadow: 0 0 0 3px rgba(110, 242, 176, .25); }
.m-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 10px; overflow-x: auto; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.m-kpis::-webkit-scrollbar { display: none; }
.m-tile { scroll-snap-align: start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px;
  color: var(--txt); box-shadow: var(--shadow); text-decoration: none !important; min-height: 118px; }
.m-tile .lbl { font-size: 12px; color: var(--mut); } .m-tile .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.m-tile .val small { font-size: 13px; color: var(--mut); font-weight: 500; } .m-tile .sub { font-size: 11.5px; color: var(--mut); }
.m-tile .spark, .m-tile .bar, .m-tile .stack { margin-top: auto; }
.m-tile.warn { border-color: #F3D19B; background: #FFFAF1; } .m-tile.warn .val { color: #B26F0C; }
.stack { display: flex; height: 7px; border-radius: 4px; overflow: hidden; gap: 2px; } .stack i { display: block; height: 100%; }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 0 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.m-card h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cnt { background: var(--chip); color: var(--pri); font-size: 11.5px; border-radius: 10px; padding: 0 8px; } .cnt.warn { background: #FCF0DC; color: #9A6212; }
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-stats > div { background: #F6F8FB; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.m-stats b { font-size: 15px; font-variant-numeric: tabular-nums; } .m-stats span { font-size: 11px; color: var(--mut); }
.cmp { display: flex; flex-direction: column; gap: 10px; } .cmp > div { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.cbar { height: 12px; background: #EEF1F5; border-radius: 6px; overflow: hidden; } .cbar i { display: block; height: 100%; border-radius: 6px; }
.m-alert { display: flex; gap: 12px; align-items: center; padding: 8px 2px; border-bottom: 1px solid #EEF1F5; color: var(--txt); text-decoration: none !important; }
.m-alert:last-child { border-bottom: 0; } .m-alert .grow { display: flex; flex-direction: column; }
.m-alert .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #E5EFFB; flex: none; }
.m-alert .ic.warn { background: #FCF0DC; } .m-alert .ic.bad { background: #FBE6E6; }
.m-card .donut { justify-content: center; }

/* ---------- farm owner app (v2) */
.phone { position: relative; }
.phone-top h1 { margin-top: 12px; font-size: 22px; }
.ph-brand { font-weight: 700; } .ph-back { color: #fff; font-weight: 600; }
.phone-body { padding-bottom: 84px; }
.ph-hero { background: linear-gradient(140deg, #2F6B3A, #4E8F3A 70%, #7FA65A); color: #fff; border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 18px rgba(47, 107, 58, .25); }
.ph-big { font-size: 40px; font-weight: 700; line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ph-ok { display: inline-block; margin-top: 8px; background: rgba(255, 255, 255, .18); border-radius: 12px; padding: 3px 10px; font-size: 12.5px; }
.phone .ph-cta { margin-top: 10px; background: #fff; color: #2F6B3A; border-color: #fff; font-size: 15px; }
.ph-flock { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #EEF1F5; color: var(--txt); text-decoration: none !important; }
.ph-flock:last-child { border-bottom: 0; }
.task { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #EEF1F5; cursor: pointer; font-size: 14.5px; }
.task:last-child { border-bottom: 0; }
.task input { width: 22px; height: 22px; accent-color: #2F6B3A; flex: none; }
.task .tm { color: #2F6B3A; font-weight: 700; min-width: 44px; font-size: 13px; }
.task.done .grow { text-decoration: line-through; color: var(--mut); }
.ph-tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 5; backdrop-filter: blur(8px); margin-top: auto; }
.ph-tabs a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--mut); text-decoration: none !important; }
.ph-tabs a span { font-size: 20px; } .ph-tabs a.on { color: #2F6B3A; font-weight: 700; }
.ph-field { display: flex; flex-direction: column; gap: 6px; } .ph-field label { font-size: 15px; font-weight: 600; }
.ph-field.big input { font-size: 30px; font-weight: 700; padding: 10px; }
.ph-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-2 .stepper { grid-template-columns: 44px 1fr 44px; }
.ph-hist { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #EEF1F5; }
.ph-hist:last-child { border-bottom: 0; }
.phone .m-stats > div { background: #F1F6EE; }

/* ---------- customer portal (v2) */
.pt-tabs { display: none; }
.pt-hero { background: linear-gradient(135deg, #0F2A4A, #1D4F91 70%, #14A39A 150%); color: #fff; border-radius: 18px; padding: 18px; display: grid; gap: 14px; }
.pt-name { font-size: 20px; font-weight: 700; }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pt-stats > div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.pt-stats b { font-size: 18px; font-variant-numeric: tabular-nums; } .pt-stats span { font-size: 11.5px; opacity: .8; }
.pt-hero .pt-cta { background: #fff; color: var(--pri); border-color: #fff; justify-self: start; }
.pt-h { font-size: 16px; margin-top: 4px; }
.pt-orders { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pt-order { display: flex; flex-direction: column; gap: 6px; } .pt-amt { font-size: 17px; }
.trk { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 6px; }
.trk > div { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; font-size: 10px; color: var(--mut); text-align: center; }
.trk > div::before { content: ''; position: absolute; top: 6px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.trk > div:first-child::before { display: none; }
.trk i { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; }
.trk .done i { background: var(--ok); border-color: var(--ok); } .trk .done::before, .trk .on::before { background: var(--ok); }
.trk .on i { border-color: var(--pri); background: var(--pri); box-shadow: 0 0 0 4px rgba(29, 79, 145, .15); } .trk .on { color: var(--pri); font-weight: 700; }
.pt-prods { display: grid; gap: 10px; }
.pt-prod { display: flex; align-items: center; gap: 12px; } .pt-prod.on { border-color: var(--pri); background: #F5F9FF; }
.pt-egg { width: 46px; height: 46px; border-radius: 12px; background: #FFF4DF; display: grid; place-items: center; font-size: 24px; flex: none; }
.stepper.sm { grid-template-columns: 38px 64px 38px; gap: 4px; } .stepper.sm button { font-size: 18px; border-radius: 10px; } .stepper.sm input { padding: 6px 4px; }
.pt-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; box-shadow: 0 -4px 20px rgba(15, 42, 74, .08); z-index: 4; }
.pt-bar b { font-size: 20px; }
@media (max-width: 760px) {
  .pt-desk { display: none !important; }
  .portal-top .in { padding: 10px 16px; }
  .portal-body { padding: 14px 14px 90px; }
  .pt-tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
  .pt-tabs a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--mut); text-decoration: none !important; }
  .pt-tabs a span { font-size: 20px; } .pt-tabs a.on { color: var(--pri); font-weight: 700; }
  .pt-bar { bottom: 66px; }
  .pt-prod { flex-wrap: wrap; } .pt-prod .stepper { margin-left: auto; }
  .pt-hero .pt-cta { justify-self: stretch; }
}

/* ---------- self-guided tour */
.tour { min-height: 100vh; background: var(--bg); }
.tour .in { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.tour-top { background: #fff; border-bottom: 1px solid var(--line); } .tour-top .in { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.tour-top .brand { color: var(--txt); padding: 0; } .tour-top .lang-sw { border-color: var(--line); } .tour-top .lang-sw a { color: var(--mut); } .tour-top .lang-sw a.on { background: var(--chip); color: var(--pri); }
.tour-hero { background: linear-gradient(135deg, #0F2A4A, #1D4F91 65%, #14A39A 140%); color: #fff; padding: 34px 0 30px; }
.tour-hero h1 { font-size: 30px; margin: 12px 0 6px; } .tour-hero p { max-width: 640px; opacity: .9; margin: 0 0 16px; font-size: 15px; }
.tour-prog { display: flex; align-items: center; gap: 12px; max-width: 420px; } .tour-prog .bar { flex: 1; height: 8px; background: rgba(255, 255, 255, .2); margin: 0; }
.tour-prog .bar i { background: #7FE0D6; } .tour-prog span { font-size: 13px; white-space: nowrap; }
.tour-list { display: grid; gap: 10px; padding-top: 20px !important; padding-bottom: 40px !important; }
.tour-m { display: flex; align-items: center; gap: 14px; } .tour-m.done { background: #F6FBF8; border-color: #CDE9D9; }
.tour-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--chip); display: grid; place-items: center; font-size: 24px; flex: none; }
.tour-m.done .tour-ic { background: #E3F4EC; }
.tour-cta { display: flex; align-items: center; gap: 12px; color: var(--txt); text-decoration: none !important; border-color: var(--acc); background: #F2FBFA; }
@media (max-width: 640px) { .tour-m { flex-wrap: wrap; } .tour-m .btn { width: 100%; } .tour-hero h1 { font-size: 24px; } }
.guide { position: fixed; right: 18px; bottom: 18px; width: 330px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--acc);
  border-radius: 14px; box-shadow: 0 14px 40px rgba(15, 42, 74, .22); z-index: 30; padding: 12px 14px; font-size: 13.5px; max-height: 70vh; overflow-y: auto; }
.guide.min { width: auto; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.g-pill { border: 0; background: var(--acc); color: #fff; font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 20px; cursor: pointer; box-shadow: 0 6px 18px rgba(20, 163, 154, .35); }
.g-h { display: flex; justify-content: space-between; align-items: center; color: var(--mut); font-size: 12px; font-weight: 600; }
.g-h button { border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--mut); }
.g-t { display: block; margin: 6px 0 4px; font-size: 14.5px; }
.guide ol { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 5px; }
.g-act { display: flex; gap: 6px; flex-wrap: wrap; } .g-act .btn { flex: 1; }
.g-f { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; }
@media (max-width: 760px) { .guide { left: 8px; right: 8px; width: auto; bottom: 74px; max-height: 36vh; } .guide.min { left: auto; } }
.guide.low { bottom: 84px; }
