/* Golden Master Slice 6 — Medicine / Treatment presentation only.
   Inventory authority, append-only normalized movements, edit fallbacks, and save semantics remain owned by stable-pond-ui.js + medicine-usage-service.js. */
.medicine-workspace{--medicine-ink:var(--penqo-color-text-primary, #161C24);--medicine-muted:var(--penqo-color-text-muted, #596775);--medicine-line:var(--penqo-color-border-default, #DFE5EC);--medicine-soft:#f7faf8;--medicine-green:var(--penqo-color-brand-primary, #007B45);--medicine-gold:var(--penqo-color-brand-secondary, #0E7490);display:grid;gap:18px;color:var(--medicine-ink)}
.medicine-workspace .pond-module-header{padding:20px 22px;border:1px solid rgba(13,105,69,.14);border-radius:20px;background:var(--penqo-color-surface-primary, #FFFFFF);box-shadow:0 10px 28px rgba(23,54,42,.06)}
.medicine-workspace .pond-module-kicker{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:var(--penqo-color-surface-secondary, #F1F4F7);color:var(--medicine-green);font-size:11px;font-weight:800;letter-spacing:.02em}
.medicine-workspace .pond-module-title{margin:7px 0 3px;font-size:24px;line-height:1.2;color:var(--medicine-ink)}
.medicine-workspace .pond-module-desc{max-width:760px;color:var(--medicine-muted)}
.medicine-workspace .pond-module-primary-btn{min-height:44px;padding:0 18px;border-radius:12px;background:var(--penqo-color-action-primary-bg, #007B45)!important;box-shadow:0 3px 0 #006136,0 8px 18px rgba(13,105,69,.18)!important;font-weight:800}
.medicine-workspace .pond-kpi-row{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
.medicine-workspace .pond-kpi-card{min-height:112px!important;padding:15px 16px!important;border:1px solid rgba(148,163,184,.24)!important;border-radius:18px!important;background:var(--penqo-color-surface-primary, #FFFFFF)!important;box-shadow:0 6px 20px rgba(15,23,42,.045)!important}
.medicine-workspace .pond-kpi-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.medicine-workspace .pond-kpi-title{font-size:11px;font-weight:800;color:var(--penqo-color-text-muted, #596775);letter-spacing:.02em}.medicine-workspace .pond-kpi-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--penqo-color-status-success-bg, #E6F4EB);color:var(--medicine-green)}.medicine-workspace .pond-kpi-val{margin-top:11px;font-size:24px;line-height:1.08;font-weight:900;color:var(--penqo-color-brand-primary, #007B45);font-variant-numeric:tabular-nums}.medicine-workspace .pond-kpi-sub{margin-top:5px;font-size:11px;color:var(--penqo-color-text-muted, #596775);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.medicine-workspace .pond-operations-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:18px;align-items:start}.medicine-workspace .pond-operations-main,.medicine-workspace .pond-operations-secondary{min-width:0}.medicine-workspace .pond-operations-secondary{display:grid;gap:14px}.medicine-workspace .pond-op-card{overflow:hidden;border:1px solid rgba(148,163,184,.25);border-radius:18px;background:var(--penqo-color-surface-primary, #FFFFFF);box-shadow:0 8px 24px rgba(15,23,42,.045)}.medicine-workspace .pond-op-head{padding:16px 18px;border-bottom:1px solid var(--penqo-color-border-default, #DFE5EC);background:var(--penqo-color-surface-primary, #FFFFFF)}.medicine-workspace .pond-op-title{font-size:15px;color:var(--medicine-ink)}.medicine-workspace .pond-op-kicker{font-size:11px;color:var(--penqo-color-text-muted, #596775)}
.medicine-workspace .pond-op-table-wrap{max-width:100%;overflow-x:auto}.medicine-workspace .pond-clean-table{width:100%;min-width:790px;border-collapse:collapse;font-size:11px}.medicine-workspace .pond-clean-table th{padding:11px 10px;background:var(--medicine-soft);color:var(--penqo-color-text-muted, #596775);font-size:10px;font-weight:800;white-space:nowrap}.medicine-workspace .pond-clean-table td{padding:12px 10px;border-top:1px solid var(--penqo-color-border-default, #DFE5EC);color:var(--penqo-color-text-primary, #161C24);vertical-align:middle}.medicine-workspace .pond-clean-table td:first-child{white-space:nowrap;font-weight:700;color:var(--penqo-color-text-primary, #161C24)}.medicine-workspace .pond-clean-table td:nth-child(2){min-width:170px;color:var(--penqo-color-text-primary, #161C24)}.medicine-workspace .pond-clean-table td:nth-child(3){min-width:180px}.medicine-workspace .pond-clean-table td:nth-child(4),.medicine-workspace .pond-clean-table td:nth-child(6){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.medicine-workspace .pond-clean-table td:nth-child(6){font-weight:800;color:var(--medicine-green)}.medicine-workspace .pond-clean-table .tag{display:inline-flex;padding:2px 7px;border:1px solid var(--penqo-color-status-info-border, #95C4DB);border-radius:7px;background:var(--penqo-color-status-info-bg, #E9F4F9);color:var(--penqo-color-status-info-fg, #175473);font-size:10px;font-weight:750;white-space:nowrap}
.medicine-workspace .pond-status-guides{padding:0 14px 14px}.medicine-workspace .pond-guide-row{margin-top:10px;padding:12px;border:1px solid var(--penqo-color-border-default, #DFE5EC);border-radius:12px;background:var(--penqo-color-surface-primary, #FFFFFF)}.medicine-workspace .pond-guide-info b{font-size:12px;color:var(--penqo-color-text-primary, #161C24)}.medicine-workspace .pond-guide-info span{font-size:10.5px;line-height:1.45;color:var(--penqo-color-text-muted, #596775)}.medicine-workspace .guide-dot-pill{width:7px;height:7px;margin-top:4px}.medicine-workspace .guide-dot-pill.is-emerald{background:var(--penqo-color-action-primary-bg, #007B45)}.medicine-workspace .guide-dot-pill.is-gold{background:var(--penqo-color-status-warning-bg, #FFF6E0)}
.medicine-workspace .mobile-medicine-history-list{display:none}
.medicine-log-modal{place-items:start center!important;overflow:hidden;overscroll-behavior:contain}.medicine-log-modal .modal-card{margin:0!important;max-height:calc(100dvh - 20px)!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}.modal-card:has(.stable-medicine-mix){border-radius:18px!important;border:1px solid rgba(13,105,69,.18)!important;box-shadow:0 20px 60px rgba(15,23,42,.16)!important}.stable-medicine-mix .stable-feed-mix-head h4{color:var(--penqo-color-text-primary, #161C24)}.stable-medicine-mix .stable-feed-mix-head span{color:var(--penqo-color-text-muted, #596775)}.modal-card:has(.stable-medicine-mix) .pond-form-submit{min-height:44px;background:var(--brand-green,var(--penqo-color-action-primary-bg, #007B45))!important}
@media(min-width:901px){.medicine-log-modal .modal-card:has(.stable-medicine-mix){width:min(820px,calc(100vw - 40px))!important}.medicine-log-modal .stable-medicine-label,.medicine-log-modal .stable-medicine-line{grid-template-columns:minmax(0,1.6fr) minmax(96px,.7fr) minmax(120px,.9fr)!important}.medicine-log-modal .stable-medicine-line:has(.danger-icon){grid-template-columns:minmax(0,1.6fr) minmax(96px,.7fr) minmax(120px,.9fr) 40px!important}.medicine-workspace .medicine-history-table{max-width:100%;overflow-x:hidden}.medicine-workspace .medicine-history-table .pond-clean-table{width:100%;min-width:0;table-layout:fixed}.medicine-workspace .medicine-history-table .pond-clean-table th:nth-child(1){width:72px}.medicine-workspace .medicine-history-table .pond-clean-table th:nth-child(4){width:70px}.medicine-workspace .medicine-history-table .pond-clean-table th:nth-child(5){width:84px}.medicine-workspace .medicine-history-table .pond-clean-table th:nth-child(6){width:72px}.medicine-workspace .medicine-history-table .pond-clean-table th:nth-child(7){width:62px}.medicine-workspace .medicine-history-table .pond-clean-table td:nth-child(2),.medicine-workspace .medicine-history-table .pond-clean-table td:nth-child(3){min-width:0;overflow-wrap:anywhere;word-break:break-word}}
@media(max-width:900px){.medicine-workspace{gap:7px}.medicine-workspace .pond-module-header{padding:10px 11px;border-radius:14px;display:grid;gap:6px}.medicine-workspace .pond-module-kicker{padding:3px 8px;font-size:10px}.medicine-workspace .pond-module-title{margin:4px 0 1px;font-size:18px}.medicine-workspace .pond-module-desc{font-size:10px;line-height:1.3}.medicine-workspace .pond-module-primary-btn{width:100%;min-height:40px}.medicine-workspace .pond-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}.medicine-workspace .pond-kpi-card{min-height:74px!important;padding:8px 9px!important;border-radius:12px!important}.medicine-workspace .pond-kpi-row .pond-kpi-card:last-child{grid-column:1/-1!important;min-height:66px!important}.medicine-workspace .pond-kpi-title{font-size:9.5px}.medicine-workspace .pond-kpi-icon{width:22px;height:22px;border-radius:7px}.medicine-workspace .pond-kpi-val{font-size:16px;margin-top:5px}.medicine-workspace .pond-kpi-sub{font-size:9px;margin-top:2px}.medicine-workspace .pond-operations-layout{display:flex;flex-direction:column;gap:8px}.medicine-workspace .pond-operations-main{order:0;width:100%}.medicine-workspace .pond-operations-secondary{order:1;width:100%;gap:8px}.medicine-workspace .pond-op-card{border-radius:12px}.medicine-workspace .pond-op-head{padding:9px 10px;margin-bottom:0!important}.medicine-workspace .pond-op-title{font-size:14px;margin:0}.medicine-workspace .pond-op-kicker{font-size:9.5px}.medicine-workspace .pond-status-guides{padding:0 8px 8px}.medicine-workspace .pond-guide-row{margin-top:7px;padding:8px 9px}.medicine-workspace .pond-guide-info b{font-size:10.5px}.medicine-workspace .pond-guide-info span{font-size:9.5px}.medicine-log-modal .modal-card:has(.stable-medicine-mix){width:calc(100vw - 16px)!important;max-width:440px!important;margin:0!important;max-height:calc(100svh - 16px)!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain!important;scrollbar-gutter:stable}}
@media(max-width:600px){.medicine-workspace .medicine-history-table{display:none!important}.medicine-workspace .mobile-medicine-history-list{display:grid!important;gap:6px;width:100%;max-width:100%;min-width:0;padding:7px;box-sizing:border-box;overflow-x:hidden!important;overflow-y:auto!important}.medicine-workspace .mobile-medicine-history-head{display:none!important}.medicine-workspace .mobile-medicine-history-row{display:block!important;width:100%;max-width:100%;min-width:0!important;min-height:0!important;padding:9px 10px!important;box-sizing:border-box;overflow:hidden;border:1px solid var(--penqo-color-border-default, #DFE5EC)!important;border-radius:11px!important;background:var(--penqo-color-surface-primary, #FFFFFF)!important;color:var(--penqo-color-text-primary, #161C24)!important;text-align:left!important;font:inherit!important;cursor:pointer!important}.medicine-workspace .mobile-medicine-history-row:active{background:var(--penqo-color-surface-secondary, #F1F4F7)!important}.medicine-workspace .medicine-mobile-meta{display:block;margin-bottom:2px;color:var(--penqo-color-text-muted, #596775);font-size:9.5px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.medicine-workspace .medicine-mobile-name{display:block;min-width:0;overflow-wrap:anywhere;color:var(--penqo-color-text-primary, #161C24);font-size:11.5px;line-height:1.3;white-space:normal}.medicine-workspace .medicine-mobile-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-top:7px;padding-top:6px;border-top:1px solid var(--penqo-color-border-default, #DFE5EC);min-width:0;flex-wrap:wrap}.medicine-workspace .medicine-mobile-usage{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 190px;flex-wrap:wrap}.medicine-workspace .medicine-mobile-usage>strong{font-size:11px;color:var(--penqo-color-text-primary, #161C24);white-space:nowrap}.medicine-workspace .medicine-mobile-usage>em{padding:2px 6px;border-radius:6px;background:var(--penqo-color-status-info-bg, #E9F4F9);color:var(--penqo-color-status-info-fg, #175473);font-size:9px;font-style:normal;font-weight:750;white-space:nowrap}.medicine-workspace .medicine-mobile-usage>small{color:var(--penqo-color-text-muted, #596775);font-size:8.5px;white-space:nowrap}.medicine-workspace .medicine-mobile-cost{display:flex;align-items:baseline;gap:3px;color:var(--medicine-green);font-size:11px;white-space:nowrap}.medicine-workspace .medicine-mobile-cost small{font-size:8.5px;color:var(--penqo-color-text-muted, #596775);font-weight:600}.medicine-workspace .mobile-table-hint{margin:2px 0 1px;color:var(--penqo-color-text-muted, #596775);font-size:9px;text-align:center}.medicine-workspace .pond-clean-empty{min-height:110px;padding:18px}}
:root[data-theme="dark"] .medicine-workspace{--medicine-ink:var(--penqo-color-text-primary, #F1F5F9);--medicine-muted:var(--penqo-color-text-muted, #94A3B8);--medicine-line:var(--penqo-color-border-default, #2E3B4A);--medicine-soft:#193a35;--medicine-green:var(--penqo-color-brand-primary, #34D38B)}
:root[data-theme="dark"] .medicine-workspace .pond-module-header,:root[data-theme="dark"] .medicine-workspace .pond-kpi-card,:root[data-theme="dark"] .medicine-workspace .pond-op-card{background:var(--penqo-color-surface-inset, #121820);border-color:var(--penqo-color-border-default, #2E3B4A)}:root[data-theme="dark"] .medicine-workspace .pond-module-title,:root[data-theme="dark"] .medicine-workspace .pond-kpi-val,:root[data-theme="dark"] .medicine-workspace .pond-op-title{color:var(--penqo-color-status-info-fg, #78CCF5)}:root[data-theme="dark"] .medicine-workspace .pond-op-head,:root[data-theme="dark"] .medicine-workspace .pond-clean-table th,:root[data-theme="dark"] .medicine-workspace .pond-guide-row,:root[data-theme="dark"] .medicine-workspace .mobile-medicine-history-row{background:var(--penqo-color-surface-primary, #171E26);border-color:var(--penqo-color-border-default, #2E3B4A)}:root[data-theme="dark"] .medicine-workspace .medicine-mobile-name,:root[data-theme="dark"] .medicine-workspace .medicine-mobile-usage>strong{color:var(--penqo-color-text-primary, #F1F5F9)}
.medicine-log-modal .medicine-entry-intro{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin:0 0 12px;padding:11px 13px;border:1px solid var(--penqo-color-border-default, #DFE5EC);border-radius:13px;background:var(--penqo-color-surface-primary, #FFFFFF);color:var(--penqo-color-brand-primary, #007B45)}.medicine-log-modal .medicine-entry-intro b{font-size:13px}.medicine-log-modal .medicine-entry-intro span{max-width:520px;color:var(--penqo-color-text-muted, #596775);font-size:11px;line-height:1.45}.medicine-log-modal .medicine-latest-guide{margin:0 0 12px;padding:12px 13px;border:1px solid var(--penqo-color-border-strong, #919EAB);border-radius:15px;background:var(--penqo-color-surface-primary, #FFFFFF);box-shadow:0 5px 16px rgba(13,105,69,.05)}.medicine-log-modal .medicine-latest-guide-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.medicine-log-modal .medicine-latest-guide-head>div{display:grid;gap:2px}.medicine-log-modal .medicine-latest-guide-head span,.medicine-log-modal .medicine-step-kicker,.medicine-log-modal .medicine-section-title>div>span{font-size:9px;font-weight:900;letter-spacing:.08em;color:var(--penqo-color-brand-primary, #007B45)}.medicine-log-modal .medicine-latest-guide-head b{font-size:15px;color:var(--penqo-color-text-primary, #161C24)}.medicine-log-modal .medicine-latest-guide-head em{padding:4px 8px;border-radius:999px;background:var(--penqo-color-surface-secondary, #F1F4F7);color:var(--penqo-color-brand-primary, #007B45);font-size:9px;font-weight:800;font-style:normal;white-space:nowrap}.medicine-log-modal .medicine-latest-guide-items{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}.medicine-log-modal .medicine-latest-guide-items>span{display:grid;gap:1px;min-width:0;padding:6px 9px;border:1px solid rgba(13,105,69,.1);border-radius:9px;background:var(--penqo-color-surface-primary, #FFFFFF)}.medicine-log-modal .medicine-latest-guide-items b{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--penqo-color-text-primary, #161C24);font-size:10.5px}.medicine-log-modal .medicine-latest-guide-items small{color:var(--penqo-color-text-muted, #596775);font-size:9px}.medicine-log-modal .medicine-latest-guide p{margin:8px 0 0;color:var(--penqo-color-text-muted, #596775);font-size:9.5px;line-height:1.4}.medicine-log-modal .medicine-latest-guide.is-empty{border-style:dashed;background:var(--penqo-color-surface-primary, #FFFFFF)}.medicine-log-modal .medicine-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.medicine-log-modal .medicine-section-title>div{display:grid;gap:1px}.medicine-log-modal .medicine-section-title h4,.medicine-log-modal .medicine-entry-head h4{margin:0;color:var(--penqo-color-text-primary, #161C24);font-size:14px}.medicine-log-modal .medicine-section-title small,.medicine-log-modal .medicine-entry-head small{color:var(--penqo-color-text-muted, #596775);font-size:9.5px}.medicine-log-modal .medicine-entry-date,.medicine-log-modal .medicine-entry-stock{padding:12px!important;border:1px solid var(--penqo-color-border-default, #DFE5EC)!important;border-radius:15px!important;background:var(--penqo-color-surface-primary, #FFFFFF)!important}.medicine-log-modal .medicine-entry-stock{margin-top:10px}.medicine-log-modal .stable-medicine-line{display:grid;gap:8px;align-items:center;padding:9px;border:1px solid var(--penqo-color-border-default, #DFE5EC);border-radius:12px;background:var(--penqo-color-surface-primary, #FFFFFF)}.medicine-log-modal .stable-medicine-line+.stable-medicine-line{margin-top:8px}.medicine-log-modal .stable-medicine-line select,.medicine-log-modal .stable-medicine-line input{height:44px!important;min-height:44px!important;border:1px solid var(--penqo-color-border-default, #DFE5EC)!important;border-radius:10px!important;background:var(--penqo-color-surface-input, #FFFFFF)!important;color:var(--penqo-color-text-primary, #161C24)!important;font:inherit!important}.medicine-log-modal .stableMedicineQty{font-variant-numeric:tabular-nums}.medicine-log-modal .medicine-line-remove{min-width:40px;min-height:40px;border-radius:9px!important}.medicine-log-modal .medicine-stock-details{display:grid;gap:6px;margin-top:9px!important;padding:0!important;background:transparent!important}.medicine-log-modal .medicine-stock-preview{display:flex;align-items:flex-start;gap:8px;padding:8px 9px;border-radius:10px;background:var(--penqo-color-surface-secondary, #F1F4F7)}.medicine-log-modal .medicine-stock-preview-index{display:grid;place-items:center;flex:0 0 22px;width:22px;height:22px;border-radius:7px;background:var(--penqo-color-surface-inset, #EBEEF2);color:var(--penqo-color-brand-primary, #007B45);font-size:9px;font-weight:900}.medicine-log-modal .medicine-stock-preview>div{display:grid;gap:1px;min-width:0}.medicine-log-modal .medicine-stock-preview b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--penqo-color-text-primary, #161C24);font-size:10.5px}.medicine-log-modal .medicine-stock-preview small{color:var(--penqo-color-text-muted, #596775);font-size:9px}.medicine-log-modal .medicine-stock-preview em{color:var(--penqo-color-brand-primary, #007B45);font-size:9px;font-style:normal;font-weight:750}.medicine-log-modal .medicine-entry-confirm-note{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:11px 0 7px;padding:8px 10px;border-radius:10px;background:var(--penqo-color-status-warning-bg, #FFF6E0);color:var(--penqo-color-status-warning-fg, #784C00)}.medicine-log-modal .medicine-entry-confirm-note b{font-size:10px}.medicine-log-modal .medicine-entry-confirm-note span{font-size:9px;text-align:right}.medicine-log-modal .pond-form-submit{border-radius:13px!important;background:var(--penqo-color-action-primary-bg, #007B45)!important;box-shadow:0 3px 0 #006136,0 7px 16px rgba(13,105,69,.16)!important}.medicine-log-modal .pond-form-submit:disabled{opacity:.65;box-shadow:none!important}
@media(max-width:900px){.medicine-log-modal{place-items:end center!important;padding:0 8px max(8px,env(safe-area-inset-bottom))!important}.medicine-log-modal .modal-card:has(.stable-medicine-mix){width:100%!important;max-width:440px!important;max-height:calc(100svh - 12px)!important;border-radius:22px 22px 16px 16px!important;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}.medicine-log-modal .medicine-entry-intro{display:grid;gap:2px;margin-bottom:8px;padding:8px 10px}.medicine-log-modal .medicine-entry-intro b{font-size:12px}.medicine-log-modal .medicine-entry-intro span{font-size:9.5px}.medicine-log-modal .medicine-latest-guide{margin-bottom:8px;padding:9px 10px;border-radius:12px}.medicine-log-modal .medicine-latest-guide-head b{font-size:13px}.medicine-log-modal .medicine-latest-guide-head em{font-size:8px}.medicine-log-modal .medicine-latest-guide-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:7px}.medicine-log-modal .medicine-latest-guide-items>span{padding:5px 7px}.medicine-log-modal .medicine-latest-guide-items b{max-width:none;font-size:10px}.medicine-log-modal .medicine-entry-date,.medicine-log-modal .medicine-entry-stock{padding:9px!important;border-radius:12px!important}.medicine-log-modal .medicine-entry-date .feed-date-field{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;align-items:end!important}.medicine-log-modal .medicine-entry-date .field{margin:0!important}.medicine-log-modal .medicine-entry-date .field>span{display:block;margin-bottom:3px;color:var(--penqo-color-text-muted, #596775);font-size:9px;font-weight:800}.medicine-log-modal .medicine-entry-date .field i{color:var(--penqo-color-status-critical-fg, #A6201A);font-style:normal}.medicine-log-modal .medicine-entry-date input{height:42px!important}.medicine-log-modal .medicine-entry-date .feed-next-date{min-height:42px!important;padding:0 10px!important;font-size:9px!important;white-space:nowrap}.medicine-log-modal .medicine-entry-head{align-items:end!important}.medicine-log-modal .medicine-entry-head .outline{min-height:38px;padding:0 10px;font-size:9.5px}.medicine-log-modal .stable-medicine-label{display:none!important}.medicine-log-modal .stable-medicine-line,.medicine-log-modal .stable-medicine-line:has(.danger-icon){grid-template-columns:minmax(0,1fr) 118px!important;padding:7px!important}.medicine-log-modal .stableMedicineStock{grid-column:1/-1}.medicine-log-modal .stable-medicine-line.has-remove .stableMedicineStock{grid-column:1/2}.medicine-log-modal .stable-medicine-line.has-remove .medicine-line-remove{grid-column:2;grid-row:1}.medicine-log-modal .stableMedicineQty{grid-column:1}.medicine-log-modal .stableMedicineMethod{grid-column:2}.medicine-log-modal .stable-medicine-line select,.medicine-log-modal .stable-medicine-line input{height:42px!important;min-height:42px!important;font-size:12px!important}.medicine-log-modal .medicine-stock-preview{padding:7px}.medicine-log-modal .medicine-entry-confirm-note{margin:8px 0 6px;padding:7px 9px}.medicine-log-modal .medicine-entry-confirm-note span{max-width:190px}.medicine-log-modal .pond-form-submit{position:sticky;bottom:0;z-index:3;min-height:48px!important;margin-top:0!important}}


/* PENQO Brand Wave 1E-05B Design Tokens & Modern Elevations */
:root {
  --penqo-brand-emerald:var(--penqo-color-brand-primary, #007B45);
  --penqo-brand-emerald-hover:var(--penqo-color-brand-primary, #007B45);
  --penqo-accent-teal:var(--penqo-color-brand-secondary, #0E7490);
  --penqo-surface:var(--penqo-color-surface-primary, #FFFFFF);
  --penqo-surface-muted:var(--penqo-color-surface-primary, #FFFFFF);
  --penqo-border: var(--penqo-color-status-info-border, #95C4DB);
  --penqo-text-primary:var(--penqo-color-text-primary, #161C24);
  --penqo-text-secondary:var(--penqo-color-text-primary, #161C24);
  --penqo-radius-sm: 8px;
  --penqo-radius-md: 12px;
  --penqo-radius-lg: 16px;
  --penqo-font-sans: 'Plus Jakarta Sans', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Scoped PENQO Medicine Workspace Refinements */
.medicine-workspace {
  font-family: var(--penqo-font-sans);
}
.medicine-workspace .pond-module-kicker {
  font-family: var(--penqo-font-sans);
  background: var(--penqo-color-surface-secondary, #F1F4F7) !important;
  color: var(--penqo-color-brand-primary, #007B45) !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}
.medicine-workspace .pond-module-primary-btn {
  min-height: 44px !important;
  background: var(--penqo-color-action-primary-bg, #007B45) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(5, 150, 105, 0.25) !important;
  font-weight: 600 !important;
  transition: all 0.15s ease-in-out;
}
.medicine-workspace .pond-module-primary-btn:hover {
  background: var(--penqo-color-action-primary-bg, #007B45) !important;
}
.medicine-workspace .pond-module-header {
  border-radius: 16px !important;
  border-color: var(--penqo-color-status-info-border, #95C4DB) !important;
}
.medicine-workspace .pond-kpi-card {
  border-radius: 16px !important;
  border-color: var(--penqo-color-status-info-border, #95C4DB) !important;
}
.medicine-workspace .pond-op-card {
  border-radius: 16px !important;
  border-color: var(--penqo-color-status-info-border, #95C4DB) !important;
}
.medicine-log-modal .modal-card {
  border-radius: 16px !important;
}
.medicine-log-modal .pond-form-submit {
  min-height: 44px !important;
  background: var(--penqo-color-action-primary-bg, #007B45) !important;
  border-radius: 10px !important;
}

/* Scoped PENQO Health Observations Workspace */
.health-route {
  font-family: var(--penqo-font-sans);
  display: grid;
  gap: 16px;
}
.health-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--penqo-color-surface-primary, #FFFFFF);
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.health-workspace-head .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--penqo-color-surface-secondary, #F1F4F7);
  color: var(--penqo-color-brand-primary, #007B45);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.health-workspace-head h2 {
  margin: 6px 0 2px;
  font-size: 22px;
  font-weight: 800;
  color: var(--penqo-color-status-info-fg, #175473);
}
.health-workspace-head p {
  margin: 0;
  font-size: 13px;
  color: var(--penqo-color-text-muted, #596775);
}
.health-workspace-head .primary {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--penqo-color-action-primary-bg, #007B45);
  color: var(--penqo-color-action-primary-fg, #FFFFFF);
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(5, 150, 105, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.health-workspace-head .primary:hover {
  background: var(--penqo-color-action-primary-bg, #007B45);
}

/* Health Summary Grid */
.health-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.health-status-card,
.health-signal-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--penqo-color-surface-primary, #FFFFFF);
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.health-status-card span,
.health-signal-card span {
  font-size: 11px;
  font-weight: 700;
  color: var(--penqo-color-text-muted, #596775);
  letter-spacing: 0.02em;
}
.health-status-card strong,
.health-signal-card strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--penqo-color-status-info-fg, #175473);
  line-height: 1.1;
}
.health-status-card small,
.health-signal-card small {
  font-size: 12px;
  color: #94a3b8;
}

/* Health Quick Actions */
.health-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.health-quick-actions button {
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--penqo-color-surface-primary, #FFFFFF);
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.health-quick-actions button:hover {
  background: var(--penqo-color-status-info-bg, #E9F4F9);
  border-color: var(--penqo-color-status-info-border, #95C4DB);
}
.health-quick-actions button i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--penqo-color-surface-secondary, #F1F4F7);
  color: var(--penqo-color-brand-primary, #007B45);
  font-style: normal;
}
.health-quick-actions button b {
  display: block;
  font-size: 13px;
  color: var(--penqo-color-status-info-fg, #175473);
}
.health-quick-actions button small {
  display: block;
  font-size: 11px;
  color: var(--penqo-color-text-muted, #596775);
}

/* Health Panels */
.health-evidence-review-panel,
.health-lab-panel,
.health-timeline-panel {
  border-radius: 16px;
  background: var(--penqo-color-surface-primary, #FFFFFF);
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.health-timeline-item {
  border-radius: 12px;
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  background: var(--penqo-color-status-info-bg, #E9F4F9);
  padding: 12px 14px;
  margin-top: 8px;
}
.health-lab-card {
  border-radius: 12px;
  border: 1px solid var(--penqo-color-status-info-border, #95C4DB);
  background: var(--penqo-color-status-info-bg, #E9F4F9);
  padding: 14px 16px;
  margin-top: 8px;
}

/* Modals Precision Elevation — Unified Calm Slate & Emerald tokens */
.health-observation-modal .modal-card,
.health-mortality-modal .modal-card,
.health-lab-modal .modal-card,
.health-inventory-issue-modal .modal-card {
  border-radius: 16px !important;
  box-shadow: var(--penqo-shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)) !important;
  border: 1px solid var(--penqo-color-border-default, #DFE5EC) !important;
}
.health-observation-modal .modal-card .section-head,
.health-mortality-modal .modal-card .section-head,
.health-lab-modal .modal-card .section-head,
.health-inventory-issue-modal .modal-card .section-head {
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--penqo-color-border-default, #DFE5EC) !important;
}
.health-observation-modal .eyebrow,
.health-mortality-modal .eyebrow,
.health-lab-modal .eyebrow,
.health-inventory-issue-modal .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--penqo-color-status-success-bg, #E8F8F0);
  border: 1px solid var(--penqo-color-status-success-border, #9EDEC0);
  color: var(--penqo-color-status-success-fg, #006D3E);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.health-observation-modal input,
.health-observation-modal select,
.health-mortality-modal input,
.health-mortality-modal select,
.health-lab-modal input,
.health-lab-modal select,
.health-inventory-issue-modal input,
.health-inventory-issue-modal select {
  min-height: 44px !important;
  border-radius: 10px !important;
  border-color: var(--penqo-color-border-default, #DFE5EC) !important;
}
.health-observation-modal .primary,
.health-mortality-modal .primary,
.health-lab-modal .primary,
.health-inventory-issue-modal .primary {
  min-height: 44px !important;
  border-radius: 10px !important;
  background: var(--penqo-color-action-primary-bg, #007B45) !important;
  font-weight: 700 !important;
}
.health-observation-modal .primary:hover:not(:disabled),
.health-mortality-modal .primary:hover:not(:disabled),
.health-lab-modal .primary:hover:not(:disabled),
.health-inventory-issue-modal .primary:hover:not(:disabled) {
  background: var(--penqo-color-action-primary-hover, #006136) !important;
}

/* Scoped Dark Mode Palette */
:root[data-theme="dark"] .health-route {
  background: transparent;
}
:root[data-theme="dark"] .health-workspace-head,
:root[data-theme="dark"] .health-status-card,
:root[data-theme="dark"] .health-signal-card,
:root[data-theme="dark"] .health-quick-actions button,
:root[data-theme="dark"] .health-evidence-review-panel,
:root[data-theme="dark"] .health-lab-panel,
:root[data-theme="dark"] .health-timeline-panel {
  background: var(--penqo-color-status-info-border, #2D6280);
  border-color: var(--penqo-color-border-default, #2E3B4A);
  color: var(--penqo-color-status-info-fg, #78CCF5);
}
:root[data-theme="dark"] .health-workspace-head h2,
:root[data-theme="dark"] .health-status-card strong,
:root[data-theme="dark"] .health-signal-card strong,
:root[data-theme="dark"] .health-quick-actions button b {
  color: var(--penqo-color-status-info-fg, #78CCF5);
}
:root[data-theme="dark"] .health-workspace-head p,
:root[data-theme="dark"] .health-status-card small,
:root[data-theme="dark"] .health-signal-card small,
:root[data-theme="dark"] .health-quick-actions button small {
  color: #94a3b8;
}
:root[data-theme="dark"] .health-timeline-item,
:root[data-theme="dark"] .health-lab-card {
  background: var(--penqo-color-status-info-bg, #142B38);
  border-color: var(--penqo-color-border-default, #2E3B4A);
  color: var(--penqo-color-status-info-fg, #78CCF5);
}
:root[data-theme="dark"] .health-observation-modal .modal-card,
:root[data-theme="dark"] .health-mortality-modal .modal-card,
:root[data-theme="dark"] .health-lab-modal .modal-card,
:root[data-theme="dark"] .health-inventory-issue-modal .modal-card {
  background: var(--penqo-color-surface-modal, #171E26) !important;
  border-color: var(--penqo-color-border-strong, #4D6075) !important;
  color: var(--penqo-color-text-primary, #F1F5F9) !important;
}
:root[data-theme="dark"] .health-observation-modal input,
:root[data-theme="dark"] .health-observation-modal select,
:root[data-theme="dark"] .health-observation-modal textarea,
:root[data-theme="dark"] .health-mortality-modal input,
:root[data-theme="dark"] .health-mortality-modal select,
:root[data-theme="dark"] .health-mortality-modal textarea,
:root[data-theme="dark"] .health-lab-modal input,
:root[data-theme="dark"] .health-lab-modal select,
:root[data-theme="dark"] .health-lab-modal textarea,
:root[data-theme="dark"] .health-inventory-issue-modal input,
:root[data-theme="dark"] .health-inventory-issue-modal select {
  background: var(--penqo-color-surface-input, #141B23) !important;
  border-color: var(--penqo-color-border-default, #2E3B4A) !important;
  color: var(--penqo-color-text-primary, #F1F5F9) !important;
}
:root[data-theme="dark"] .medicine-workspace .pond-module-kicker,
:root[data-theme="dark"] .health-workspace-head .eyebrow,
:root[data-theme="dark"] .health-observation-modal .eyebrow,
:root[data-theme="dark"] .health-mortality-modal .eyebrow,
:root[data-theme="dark"] .health-lab-modal .eyebrow,
:root[data-theme="dark"] .health-inventory-issue-modal .eyebrow {
  background: rgba(5, 150, 105, 0.2) !important;
  color: var(--penqo-color-text-primary, #F1F5F9) !important;
}

/* Wave 2B-B4 medicine-master.css Coastal Earth Dark Parity */
:root[data-theme="dark"] {
  --penqo-brand-emerald: var(--penqo-color-brand-primary, #34D38B);
  --penqo-accent-teal: var(--penqo-color-brand-primary, #34D38B);
  --penqo-border: var(--penqo-color-border-default, #2E3B4A);
  --medicine-green: var(--penqo-color-brand-primary, #34D38B);
  --medicine-gold: var(--penqo-color-brand-secondary, #34D38B);
  --medicine-ink: var(--penqo-color-text-primary, #F1F5F9);
  --medicine-muted: var(--penqo-color-text-muted, #94A3B8);
  --medicine-line: var(--penqo-color-border-default, #2E3B4A);
  --medicine-soft: var(--penqo-color-surface-secondary, #1D2630);
}
:root[data-theme="dark"] .health-primary-btn,
:root[data-theme="dark"] .medicine-primary-btn,
:root[data-theme="dark"] .health-workspace-head .primary {
  background: var(--penqo-color-action-primary-bg, #0A7C4A) !important;
  border-color: var(--penqo-color-action-primary-bg, #0A7C4A) !important;
  color: var(--penqo-color-action-primary-fg, #FFFFFF) !important;
}
