:root{--nav:#123b35;--accent:#0d8a73;--soft:#eef7f4}body{background:#f4f7f6;color:#182421;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.app-nav{background:linear-gradient(135deg,#123b35,#087f69);box-shadow:0 3px 15px #0002}.nav-link.active{font-weight:700}.card{border:0;border-radius:14px;box-shadow:0 5px 20px #163d3512}.stat{padding:20px;background:#fff}.stat .icon{width:45px;height:45px;border-radius:12px;background:var(--soft);display:grid;place-items:center;color:var(--accent);font-size:22px}.page-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px}.product-grid{display:grid;grid-template-columns:repeat(5,minmax(190px,1fr));gap:10px}.product-card{background:#fff;border:1px solid #e0e8e5;border-radius:12px;padding:10px;transition:.15s}.product-card:hover{border-color:#78bdae;box-shadow:0 5px 15px #0001}.product-no{font-size:11px;color:#70807b}.product-name{font-weight:700;font-size:13px;min-height:38px}.qty{font-weight:700;text-align:right}.rate{font-size:11px;color:#71807b}.amount{font-size:12px;font-weight:700;color:#087f69}.sticky-summary{position:sticky;bottom:10px;z-index:10;background:#123b35;color:white;border-radius:14px;padding:12px 16px;box-shadow:0 8px 30px #0003}.table thead th{background:#eaf3f0}.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#123b35,#0b9277)}.login-card{width:min(420px,92vw)}.mini-card{border-radius:12px;background:#fff;border:1px solid #e3ebe8;padding:14px}.stock-ok{color:#087f69;font-weight:700}.stock-low{color:#c77b00;font-weight:700}.stock-negative{color:#c0392b;font-weight:700}.report-card{min-height:120px}.table-sm td,.table-sm th{padding:.5rem}.filter-label{font-size:12px;font-weight:700;color:#66756f;text-transform:uppercase}.chart-box{height:310px}.dashboard-link{color:inherit;text-decoration:none}@media(max-width:1200px){.product-grid{grid-template-columns:repeat(4,minmax(180px,1fr))}}@media(max-width:900px){.product-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:520px){.product-grid{grid-template-columns:1fr}.page-head{align-items:flex-start;flex-direction:column}}

/* Compact keyboard-friendly demand entry */
.demand-header-card{background:#fff}
.demand-table-card{overflow:hidden;border-radius:14px}
.demand-entry-table{font-size:14px}
.demand-entry-table thead th{position:sticky;top:0;z-index:2;background:#123b35;color:#fff;border:0;padding:10px 12px}
.demand-entry-table tbody td{padding:5px 12px;border-color:#edf1ef}
.demand-entry-table tbody tr:nth-child(even){background:#fafcfb}
.demand-entry-table tbody tr.has-qty{background:#f0faf7}
.demand-entry-table tfoot th{background:#eef7f4;border-top:2px solid #b9d9d0;padding:11px 12px;font-size:15px}
.product-code{font-weight:800;width:80px;color:#52615d}
.product-name-cell{font-weight:700;min-width:280px}
.qty-col,.qty-input{width:115px}
.qty-input{height:36px;font-weight:800;text-align:right;font-size:16px;border:1px solid #b9c9c4;background:#fffdf3}
.qty-input:focus{border-color:#087f69;box-shadow:0 0 0 .2rem rgba(8,127,105,.18);background:#fff}
.rate-col,.rate-cell{width:130px}
.total-col,.total-cell{width:160px;font-weight:800}
.rate-cell{color:#5d6d68}
.total-cell{color:#087f69}
.demand-bottom-bar{position:sticky;bottom:10px;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:15px;background:#123b35;color:#fff;border-radius:14px;padding:10px 14px;box-shadow:0 8px 30px #0003}
.demand-bottom-bar .btn-warning{font-weight:800}
@media(max-width:700px){
  .product-name-cell{min-width:210px}
  .qty-col,.qty-input{width:100px}
  .rate-col,.rate-cell{width:105px}
  .total-col,.total-cell{width:125px}
  .demand-bottom-bar{position:static}
}

/* 50:50 demand entry layout */
.demand-entry-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px;
  align-items:start;
  width:100%;
}
.demand-entry-layout>.card{min-width:0}
.demand-header-card{height:100%;margin-bottom:0}
.demand-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:2px 2px 12px;
  margin-bottom:10px;
  border-bottom:1px solid #e8efed;
}
.demand-section-title>div{
  display:flex;
  align-items:center;
  gap:10px;
}
.demand-section-title strong{
  display:block;
  font-size:15px;
  color:#193b35;
}
.demand-section-title small{
  display:block;
  margin-top:2px;
  color:#71807b;
  font-size:11px;
}
.demand-section-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#eaf6f2;
  color:#087f69;
  font-size:17px;
}
.demand-hint{font-size:11px;color:#71807b;white-space:nowrap}
.demand-hint kbd{padding:2px 6px;border:1px solid #d4dfdc;border-radius:5px;background:#f7faf9;color:#52615d}
.demand-entry-layout .form-label{
  margin-bottom:4px;
  font-size:11px;
  font-weight:700;
  color:#62716d;
}
.demand-entry-layout .form-control,
.demand-entry-layout .form-select{
  min-height:38px;
  border-color:#dbe6e2;
  font-size:13px;
}
.demand-table-card{margin-bottom:0}
.demand-table-card .table-responsive{max-height:calc(100vh - 270px);overflow:auto}
.demand-entry-table{table-layout:fixed;width:100%}
.demand-entry-table .product-name-cell{min-width:0;white-space:normal;word-break:break-word}
.demand-entry-table .product-code{width:60px}
.demand-entry-table .qty-col,.demand-entry-table .qty-input{width:78px}
.demand-entry-table .rate-col,.demand-entry-table .rate-cell{width:82px}
.demand-entry-table .total-col,.demand-entry-table .total-cell{width:95px}
.demand-entry-table tbody td{padding:4px 7px;font-size:12px}
.demand-entry-table thead th{padding:8px 7px;font-size:11px}
.demand-entry-table tfoot th{padding:8px 7px;font-size:12px}
.demand-entry-table .qty-input{height:32px;padding:4px 6px;font-size:14px}
@media(max-width:1050px){
  .demand-entry-layout{grid-template-columns:1fr}
  .demand-table-card .table-responsive{max-height:none}
}

/* Two-panel product entry */
.demand-product-columns{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
  align-items:start;
}
.demand-product-half{
  min-width:0;
  border:1px solid #e3ece9;
  border-radius:10px;
  overflow:hidden;
  background:#fff;
}
.demand-product-half .table-responsive{
  max-height:calc(100vh - 300px);
  overflow:auto;
}
.demand-product-half .demand-entry-table{
  table-layout:fixed;
  width:100%;
}
.demand-product-half .demand-entry-table .product-code{width:48px}
.demand-product-half .demand-entry-table .product-name-cell{min-width:0;white-space:normal;word-break:break-word}
.demand-product-half .demand-entry-table .qty-col,
.demand-product-half .demand-entry-table .qty-input{width:64px}
.demand-product-half .demand-entry-table .rate-col,
.demand-product-half .demand-entry-table .rate-cell{width:70px}
.demand-product-half .demand-entry-table .total-col,
.demand-product-half .demand-entry-table .total-cell{width:78px}
.demand-product-half .demand-entry-table tbody td{padding:5px 5px;font-size:11px}
.demand-product-half .demand-entry-table thead th{padding:7px 5px;font-size:10px}
.demand-product-half .demand-entry-table .qty-input{height:30px;padding:3px 5px;font-size:13px}
.demand-products-summary{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:20px;
  align-items:center;
  margin-top:10px;
  padding:9px 12px;
  border-radius:10px;
  background:#eef7f4;
  border:1px solid #d8e9e4;
  color:#29413b;
  font-size:12px;
}
.demand-products-summary .summary-grand{font-size:13px;color:#087f69}
.demand-products-summary strong{font-weight:800}
@media(max-width:1050px){
  .demand-product-columns{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .demand-product-columns{grid-template-columns:1fr}
  .demand-product-half .table-responsive{max-height:none}
  .demand-products-summary{grid-template-columns:1fr 1fr}
  .demand-products-summary .summary-grand{grid-column:1/-1}
}
