/* Meal Route / Interface Foundation v1.1
   Progressive, presentation-only override. Loaded after the legacy stylesheet.
   No API, inventory, challan, or business logic changes.
*/
:root {
  --ui-ink: #16253b;
  --ui-ink-soft: #344760;
  --ui-muted: #586c84;
  --ui-subtle: #77879a;
  --ui-canvas: #f3f6fa;
  --ui-surface: #ffffff;
  --ui-border: #dae3ec;
  --ui-border-light: #e9eef4;
  --ui-teal: #087d73;
  --ui-teal-dark: #075f59;
  --ui-teal-pale: #e8f5f2;
  --ui-navy: #14243a;
  --ui-warning: #9c640e;
  --ui-danger: #ad302e;
  --ui-radius-sm: 8px;
  --ui-radius: 12px;
  --ui-radius-lg: 16px;
  --ui-shadow: 0 3px 16px rgba(25,43,65,.045);
  --ui-gap-1: 4px;
  --ui-gap-2: 8px;
  --ui-gap-3: 12px;
  --ui-gap-4: 16px;
  --ui-gap-5: 24px;
  --ui-gap-6: 32px;
  color-scheme: light;
}
html {scroll-behavior:smooth; text-size-adjust:100%; -webkit-text-size-adjust:100%}
body {background:var(--ui-canvas); color:var(--ui-ink);font-size:14px;line-height:1.5}
body,button,input,select,textarea{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
::selection{background:#cce9e3;color:#14283c}
:focus-visible{outline:3px solid #44aa9a;outline-offset:3px}
button:focus-visible,a:focus-visible,[role="button"]:focus-visible{outline:3px solid #44aa9a;outline-offset:3px}
button:disabled,input:disabled,select:disabled,textarea:disabled{cursor:not-allowed;opacity:.67}

/* Shell: a consistent alignment system for headings, filters and content. */
.app{grid-template-columns:256px minmax(0,1fr);min-width:0}
.app>.main{min-width:0;max-width:100%}
.sidebar{background:linear-gradient(165deg,#14273c 0%,#102036 65%,#111e31 100%);padding:18px 12px 14px;overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#46566b transparent}
.sidebar .brand{padding:5px 10px 17px;border-bottom:1px solid rgba(255,255,255,.09);margin-bottom:11px}
.sidebar .brand-title{font-size:16px;letter-spacing:-.015em;font-weight:780;color:#f5fafb}
.sidebar .brand-sub{font-size:12px;line-height:1.45;color:#adbdcb}
.sidebar .brand-logos{gap:10px}
.sidebar .brand-logos img{background:#fff;padding:5px;border-radius:10px;height:43px}
.sidebar .nav-section{font-size:10px;font-weight:750;letter-spacing:.12em;color:#91a8bc;padding:17px 12px 7px}
.sidebar .nav-item{border-radius:10px;min-height:42px;padding:10px 12px;margin:2px 0;font-size:13px;font-weight:630;gap:12px;color:#cdd9e4;transition:background .13s ease,color .13s ease}
.sidebar .nav-item:hover{background:#223b53;color:#fff}
.sidebar .nav-item.active{background:#d9f2ea;color:#07574f;box-shadow:inset 3px 0 0 #209a8a;font-weight:770}
.sidebar .nav-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:21px;font-size:18px;line-height:1;opacity:.95}
.sidebar .nav-label{line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.sidebar .sidebar-footer{padding:15px 9px 6px;margin-top:auto;border-top:1px solid rgba(255,255,255,.11)}
.sidebar .sidebar-user{font-size:13px}
.sidebar .sidebar-role{font-size:12px}
.sidebar .project-credit{font-size:10px;line-height:1.55;color:#94aabd}
.sidebar .project-credit b{color:#d8e3ed}
.topbar{height:auto;min-height:76px;padding:12px clamp(16px,2.25vw,32px);gap:16px;box-shadow:0 1px 0 rgba(16,35,52,.04);border-color:var(--ui-border-light)}
.page-title{font-size:clamp(20px,1.55vw,25px);font-weight:790;line-height:1.2;letter-spacing:-.033em;color:var(--ui-ink)}
.page-subtitle{font-size:12.5px;line-height:1.4;margin-top:4px;color:var(--ui-muted);max-width:64ch}
.topbar>div:first-child{min-width:0;flex:1 1 220px}
.top-actions{flex-wrap:wrap;gap:8px;justify-content:flex-end;min-width:0}
.top-actions>.scope-select{width:auto;min-width:175px;max-width:300px}
.top-actions>.phase-select{min-width:170px;max-width:320px}
.top-actions>.small{font-size:12px;white-space:normal}
.content{width:100%;max-width:1720px;padding:clamp(16px,2vw,30px) clamp(16px,2.25vw,34px) 64px;margin:0 auto}
.page>*:first-child{scroll-margin-top:100px}
.page .card:first-child{margin-top:0}

/* Surface and hierarchy. */
.card{border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);padding:clamp(16px,1.4vw,22px);box-shadow:var(--ui-shadow);background:var(--ui-surface);margin-bottom:16px;min-width:0}
.card>.card-head{margin-bottom:16px}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px 14px;flex-wrap:wrap;min-width:0}
.card-head>div:first-child{min-width:0;flex:1 1 210px}
.card-head .small{max-width:90ch;margin-top:4px}
.card h2, .card-head h2{font-size:clamp(16px,1.1vw,18px);line-height:1.35;letter-spacing:-.017em;font-weight:760;color:var(--ui-ink)}
.card h3{font-size:15px;font-weight:740;line-height:1.35}
.card h2:not(.page-title) + .small{margin-top:4px}
.small{font-size:12.5px;line-height:1.55;color:var(--ui-muted);overflow-wrap:anywhere}
.asset-card,.delivery-summary-box,.ops-group-card,.ops-consumption-box,.ops-choice-card,.ops-mini-metric,.tehsil-card{border-radius:var(--ui-radius);border-color:var(--ui-border);min-width:0}
.asset-card{padding:15px}
.tehsil-card{padding:15px}
.route-card{padding:16px;border-color:var(--ui-border);border-radius:var(--ui-radius-lg)}
.route-head{flex-wrap:wrap;min-width:0}
.notice{border-radius:var(--ui-radius);padding:12px 15px;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.notice.warning,.notice.warn{background:#fff9eb;color:#7c591d;border-color:#e9d8b4}
.notice.error{background:#fff2f1;color:#9c2929;border-color:#f2cdcb}
.notice.good{background:#edf8f4;border-color:#b8e2d6}
.pill,.chip,.stamp-chip{line-height:1.25;max-width:100%;overflow-wrap:anywhere}
.pill{font-size:11px;font-weight:720;padding:5px 9px}
.divider{border:0;border-top:1px solid var(--ui-border-light);margin:22px 0}
.empty{padding:32px 18px;font-size:13px;color:var(--ui-muted)}

/* Layout grid scales: accommodate actual content instead of hard-coded equal columns. */
.grid2,.grid3,.grid4,.grid5,.tehsil-grid{gap:14px;min-width:0}
.grid2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid5,.tehsil-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.grid2>*,.grid3>*,.grid4>*,.grid5>*,.tehsil-grid>*{min-width:0}
.kpi{padding:17px}
.kpi-label,.delivery-summary-box .label{font-size:11px;letter-spacing:.045em;font-weight:710;line-height:1.45}
.kpi-value{font-size:clamp(23px,2.2vw,32px);font-weight:800;line-height:1.15;letter-spacing:-.035em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.kpi-foot{font-size:12px;line-height:1.45;margin-top:5px}
.ops-command-date,.ops-consumption-big,.ops-group-count,.ops-choice-packs{font-variant-numeric:tabular-nums}
.ops-mini-metric{padding:12px}
.ops-mini-metric span,.ops-decision-box span,.ops-consumption-label,.ops-group-sub{font-size:11px;line-height:1.45}
.ops-mini-metric small{font-size:11.5px;line-height:1.45}
.ops-mini-metric b{font-size:clamp(19px,1.5vw,24px);overflow-wrap:anywhere}
.ops-command-grid,.delivery-resource-grid{min-width:0}
.ops-command-grid>*,.delivery-resource-grid>*{min-width:0}
.ops-readiness-grid,.ops-event-grid,.ops-command-metrics,.ops-group-grid{gap:12px}
.ops-status-card,.ops-status-card button{min-width:0;overflow-wrap:anywhere}
.ops-status-label,.ops-group-title,.ops-choice-name{line-height:1.4}
.ops-status-value{font-variant-numeric:tabular-nums}

/* Forms: one shared, legible sizing system. */
.field{min-width:min(185px,100%);flex:1 1 190px;max-width:100%}
.row,.toolbar{gap:12px;min-width:0}
.row>* , .toolbar>*{min-width:0}
label{font-size:13px;font-weight:680;color:var(--ui-ink-soft);line-height:1.35;margin-bottom:7px}
input:not([type="checkbox"]):not([type="radio"]),select,textarea{min-height:41px;padding:9px 12px;border:1px solid #c5d3df;background:#fff;border-radius:var(--ui-radius-sm);font-size:14px;line-height:1.4;max-width:100%;color:var(--ui-ink);box-shadow:0 1px 1px rgba(16,34,54,.015)}
input:not([type="checkbox"]):not([type="radio"]):focus,select:focus,textarea:focus{outline:0;border-color:#4f9e93;box-shadow:0 0 0 3px rgba(8,125,115,.13)}
input[type="checkbox"],input[type="radio"]{accent-color:var(--ui-teal);width:17px;height:17px;flex:none}
input[type="date"],input[type="number"]{font-variant-numeric:tabular-nums}
textarea{min-height:90px;line-height:1.55;resize:vertical}
input::placeholder,textarea::placeholder{color:#8a99a8}
:where(.app) .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;max-width:100%;padding:9px 14px;border:1px solid transparent;border-radius:9px;background:var(--ui-teal);color:#fff;font-size:13px;font-weight:750;line-height:1.3;white-space:normal;text-align:center;vertical-align:middle;box-shadow:0 1px 0 rgba(0,0,0,.04);transition:background .13s ease,border-color .13s ease,transform .13s ease}
:where(.app) .btn:hover:not(:disabled){background:var(--ui-teal-dark)}
:where(.app) .btn:active:not(:disabled){transform:translateY(1px)}
:where(.app) .btn.secondary{background:#f2f5f8;color:var(--ui-ink-soft);border-color:var(--ui-border)}
:where(.app) .btn.secondary:hover{background:#e8eef4;border-color:#b8c9d7}
:where(.app) .btn.ghost{background:#fff;color:var(--ui-teal-dark);border-color:#bfcfdc}
:where(.app) .btn.ghost:hover{background:#ecf7f4;border-color:#8fbfb6}
:where(.app) .btn.danger{background:#fff;color:var(--ui-danger);border-color:#eccacb}
:where(.app) .btn.danger:hover{background:#fff1f1}
:where(.app) .btn.sm{min-height:34px;padding:7px 11px;font-size:12px}
:where(.app) .btn:disabled{opacity:.57;transform:none;box-shadow:none}
button:not(.btn):focus-visible{outline:3px solid #44aa9a;outline-offset:3px}
.quick-check,.tehsil-check{font-size:12.5px;line-height:1.4}
.toolbar{align-items:flex-end}
.toolbar .field{flex-basis:180px}

/* Operational tables: descriptive cells WRAP; codes and quantities retain one-line semantics. */
.app .table-wrap,.app .ceo-table-wrap{overflow-x:auto;overflow-y:auto;max-width:100%;border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:#fff;scrollbar-width:thin;scrollbar-color:#adbfcf #f5f7fa;overscroll-behavior-x:contain}
.app .table-wrap.tall{max-height:min(70vh,710px)}
.app .table-wrap table,.app .ceo-table-wrap table{font-size:13px;line-height:1.45;border-collapse:separate;border-spacing:0;table-layout:auto;min-width:100%;width:max-content;max-width:none}
.app .table-wrap table th,.app .table-wrap table td,.app .ceo-table-wrap th,.app .ceo-table-wrap td{box-sizing:border-box;padding:11px 13px;text-align:left;vertical-align:middle;white-space:normal;overflow-wrap:anywhere;word-break:normal;border-bottom:1px solid #e8edf3;min-width:0;max-width:360px}
.app .table-wrap table th,.app .ceo-table-wrap th{position:sticky;top:0;background:#eef3f7;color:#44596f;font-size:11.5px;line-height:1.35;text-transform:none;letter-spacing:.015em;font-weight:760;white-space:normal;z-index:3;border-bottom:1px solid #cfdce6;vertical-align:middle}
.app .table-wrap table tbody tr:nth-child(even),.app .ceo-table-wrap tbody tr:nth-child(even){background:#f8fafc}
.app .table-wrap table tbody tr:hover,.app .ceo-table-wrap tbody tr:hover{background:#eef7f6}
.app .table-wrap table td.wrap{white-space:normal;min-width:200px;max-width:310px;overflow-wrap:break-word}
.app .table-wrap table td.ui-col-id,.app .table-wrap table td.ui-col-date,.app .table-wrap table td.ui-col-number,
.app .table-wrap table th.ui-col-id,.app .table-wrap table th.ui-col-date,.app .table-wrap table th.ui-col-number,
.app .ceo-table-wrap .ui-col-id,.app .ceo-table-wrap .ui-col-date,.app .ceo-table-wrap .ui-col-number{white-space:nowrap;overflow-wrap:normal;word-break:normal;font-variant-numeric:tabular-nums}
.app .table-wrap table td.ui-col-number,.app .table-wrap table th.ui-col-number,
.app .ceo-table-wrap td.ui-col-number,.app .ceo-table-wrap th.ui-col-number{text-align:right}
.app .table-wrap table td.ui-col-date,.app .table-wrap table th.ui-col-date{min-width:108px}
.app .table-wrap table td.ui-col-description,.app .table-wrap table th.ui-col-description,
.app .ceo-table-wrap td.ui-col-description,.app .ceo-table-wrap th.ui-col-description{min-width:190px;max-width:340px;white-space:normal}
.app .table-wrap table td.ui-col-actions,.app .table-wrap table th.ui-col-actions{min-width:115px;max-width:300px}
.app .table-wrap table td.ui-col-status,.app .table-wrap table th.ui-col-status{min-width:108px;max-width:220px}
.app .table-wrap table td .btn{margin:2px 3px 2px 0}
.app .table-wrap table .small{font-size:12px;white-space:normal;overflow-wrap:anywhere}
.app .table-wrap table button,.app .table-wrap table input,.app .table-wrap table select{max-width:100%}
/* Frozen identifiers on operational school/challan tables, not generic ledgers. */
@media(min-width:801px){
 .app .table-wrap table.ui-freeze-first thead th:first-child,.app .table-wrap table.ui-freeze-first tbody td:first-child{position:sticky;left:0;z-index:4;min-width:190px;max-width:285px;box-shadow:2px 0 4px rgba(20,37,55,.06);background:#fff}
 .app .table-wrap table.ui-freeze-first thead th:first-child{z-index:6;background:#eef3f7}
 .app .table-wrap table.ui-freeze-first tbody tr:nth-child(even) td:first-child{background:#f8fafc}
 .app .table-wrap table.ui-freeze-second thead th:nth-child(2),.app .table-wrap table.ui-freeze-second tbody td:nth-child(2){position:sticky;left:0;z-index:4;min-width:190px;max-width:285px;box-shadow:2px 0 4px rgba(20,37,55,.06);background:#fff}
 .app .table-wrap table.ui-freeze-second thead th:nth-child(2){z-index:6;background:#eef3f7}
 .app .table-wrap table.ui-freeze-second tbody tr:nth-child(even) td:nth-child(2){background:#f8fafc}
}
/* The 13-column government report remains a worksheet-style preview but must scroll accessibly. */
.app .ceo-report-paper{border:1px solid var(--ui-border);box-shadow:var(--ui-shadow);border-radius:var(--ui-radius-lg);padding:20px;color:var(--ui-ink)}
.app .ceo-header{flex-wrap:wrap;gap:14px;min-width:0;border-bottom:1px solid var(--ui-border);padding-bottom:17px}
.app .ceo-header h3{color:var(--ui-teal-dark);font-size:17px;line-height:1.35}
.app .ceo-header>div{flex:1 1 240px;min-width:0;overflow-wrap:anywhere}
.app .ceo-header img{flex:none;width:72px;height:72px}
.app .ceo-table-wrap table{font-size:12.5px}
.app .ceo-table-wrap th{background:#e3f1ee;color:#1a615a;min-width:98px}
.app .ceo-table-wrap td{white-space:normal;max-width:260px}
.app .ceo-footer{gap:24px}
.app .ceo-footer>div{flex:1 1 280px;min-width:0}
.app .ceo-footer>table{display:table;flex:2 1 430px;min-width:0;width:auto;max-width:100%;font-size:12.5px}
.app .ceo-footer td,.app .ceo-footer th{padding:9px;white-space:normal;overflow-wrap:anywhere}
.app .ceo-settings-grid{grid-template-columns:repeat(auto-fill,minmax(min(235px,100%),1fr))}
.app .ceo-report-filters .field{max-width:none;min-width:min(185px,100%)}

/* Modals: balanced dimensions and safe small-screen scrolling. */
.modal{padding:clamp(10px,2.5vw,28px);overscroll-behavior:contain}
.modal-card,.history-modal .modal-card,.challan-modal .modal-card{max-width:100%;width:min(960px,100%);max-height:min(90dvh,980px);min-width:0;border-radius:var(--ui-radius-lg);padding:clamp(15px,2.25vw,25px);box-shadow:0 26px 65px rgba(12,29,45,.24);scrollbar-width:thin}
.history-modal .modal-card{width:min(1180px,100%)}
.school-map-modal .modal-card{width:min(1180px,100%);padding:clamp(12px,2vw,20px)}
.modal-card .detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.modal-card .detail-grid>*,.modal-card .grid4>*{min-width:0}
.modal-card .card-head{position:relative}
.modal-card .table-wrap{max-width:100%}
.modal-card .table-wrap table{width:max-content;min-width:100%}
.visible-schools-map{min-height:260px;height:min(58dvh,650px)}

/* On-device navigation: tablet and phone both use a labelled, accessible drawer. */
.ui-nav-toggle{display:none;align-items:center;justify-content:center;gap:9px;flex:none;width:42px;height:42px;padding:0;border:1px solid var(--ui-border);border-radius:10px;background:#f8fafc;color:var(--ui-ink);font-size:20px;font-weight:750}
.ui-nav-toggle svg{width:20px;height:20px;display:block}
.ui-nav-scrim{display:none}
.ui-drawer-close{display:none}
.ui-settings-jump{position:relative;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px;padding:14px;background:#fff;border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg)}
.ui-settings-jump .ui-settings-label{width:100%;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--ui-subtle)}
.ui-settings-jump button{border:1px solid var(--ui-border);border-radius:99px;background:#f7fafc;color:var(--ui-ink-soft);font-size:12.5px;font-weight:690;padding:7px 12px;min-height:34px;cursor:pointer}
.ui-settings-jump button:hover{background:var(--ui-teal-pale);color:var(--ui-teal-dark);border-color:#acd9d0}
.ui-settings-target{scroll-margin-top:110px}
.ui-scroll-hint{display:none;font-size:11.5px;color:var(--ui-muted);margin:4px 0 0;line-height:1.4}

@media(max-width:1399px){
 .grid5,.tehsil-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ops-command-grid{grid-template-columns:1fr}
 .ops-command-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1100px){
 .grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ops-readiness-grid,.ops-event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .route-detail-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ops-group-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1024px){
 .app{display:block;min-height:100vh}
 .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(306px,calc(100vw - 44px));height:100dvh;max-height:100dvh;padding:17px 12px;z-index:70;transform:translateX(-110%);transition:transform .22s ease;visibility:hidden;box-shadow:18px 0 50px rgba(16,32,50,.18);overflow-y:auto}
 .sidebar .brand,.sidebar .brand-title,.sidebar .brand-sub,.sidebar .nav-label,.sidebar .nav-section,.sidebar .sidebar-user,.sidebar .sidebar-role,.sidebar .sidebar-footer{display:block}
 .sidebar .brand-logos{display:flex}
 .sidebar .nav-item{display:flex;justify-content:flex-start;width:100%;min-width:0;min-height:43px;height:auto;text-align:left;margin:2px 0}
 .sidebar .nav-item.hide{display:none!important}
 .sidebar .nav-icon{font-size:19px}
 .sidebar .sidebar-footer{display:block}
 .sidebar .project-credit{display:block}
 .app.ui-drawer-open .sidebar{transform:translateX(0);visibility:visible}
 .ui-nav-scrim{position:fixed;inset:0;z-index:65;background:rgba(8,24,38,.50);backdrop-filter:blur(2px)}
 .app.ui-drawer-open .ui-nav-scrim{display:block}
 .ui-nav-toggle{display:inline-flex}
 .ui-drawer-close{display:inline-flex;position:absolute;right:10px;top:12px;border:1px solid rgba(255,255,255,.25);background:#263b51;color:#fff;border-radius:9px;width:34px;height:34px;align-items:center;justify-content:center;font-size:21px;z-index:1}
 .sidebar .brand{padding-right:40px}
 .topbar{position:sticky;top:0;z-index:40;flex-wrap:wrap;min-height:72px;padding:13px 20px}
 .main{padding-bottom:0;min-width:0}
 .content{padding:20px 20px 52px}
}
@media(max-width:760px){
 .topbar{align-items:center;gap:12px;padding:12px 16px}
 .topbar>div:first-child{flex:1 1 calc(100% - 62px)}
 .page-title{font-size:21px}
 .page-subtitle{font-size:12px}
 .top-actions{flex:1 0 100%;justify-content:stretch;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .top-actions>.scope-select,.top-actions>.phase-select{max-width:none;width:100%;min-width:0}
 .top-actions>.small{align-self:center;min-width:0}
 .top-actions>.btn{min-width:0}
 .content{padding:16px 14px 45px}
 .card{padding:16px;border-radius:14px}
 .grid4,.grid3,.grid2,.grid5,.tehsil-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ops-command-metrics,.ops-readiness-grid,.ops-group-grid,.ops-event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .detail-grid,.modal-card .detail-grid,.route-detail-kpis,.delivery-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .card-head>div:first-child{flex:1 1 170px}
 .visible-schools-map{min-height:280px;height:48dvh}
 .app .table-wrap.tall{max-height:66dvh}
 .app .table-wrap table th,.app .table-wrap table td{padding:10px 11px}
}
@media(max-width:560px){
 .topbar{min-height:66px}
 .top-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .top-actions>.scope-select{grid-column:span 2}
 .top-actions>.phase-select{grid-column:span 2}
 .top-actions>#phaseFilterLabel{grid-column:span 2}
 .top-actions>.btn{grid-column:span 2}
 .content{padding:12px 12px 32px}
 .card{padding:15px;margin-bottom:13px}
 .grid4,.grid3,.grid2,.grid5,.tehsil-grid,.ops-readiness-grid,.ops-event-grid,.ops-group-grid,.ops-command-metrics,.ops-consumption-compare,.ops-choice-grid,.ops-decision-strip,.ops-stock-grid,.ops-compliance-grid{grid-template-columns:minmax(0,1fr)}
 .delivery-summary-grid,.route-detail-kpis,.detail-grid,.modal-card .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .field,.ceo-report-filters .field{min-width:100%;flex-basis:100%}
 .card-head>div:first-child{flex:1 1 100%}
 .card-head{align-items:flex-start}
 .card-head .btn{min-height:40px}
 .kpi-value{font-size:27px}
 .ops-status-value,.ops-consumption-big,.ops-group-count{font-size:23px}
 .btn:not(.sm){min-height:42px}
 .delivery-wizard-top,.delivery-home-head,.route-head{flex-direction:column;align-items:stretch}
 .delivery-stepper{grid-template-columns:repeat(2,minmax(0,1fr))}
 .delivery-nav-row{flex-direction:column;align-items:stretch}
 .delivery-nav-row>.right{justify-content:stretch;display:flex;flex-wrap:wrap}
 .delivery-nav-row .btn{flex:1 1 150px}
 .modal{padding:6px;align-items:flex-end}
 .modal-card,.history-modal .modal-card,.challan-modal .modal-card,.school-map-modal .modal-card{width:100%;max-width:100%;max-height:95dvh;border-radius:17px 17px 10px 10px;padding:15px;overflow-y:auto}
 .modal-card .card-head{gap:8px}
 .visible-schools-map{height:42dvh;min-height:230px}
 .app .table-wrap table,.app .ceo-table-wrap table{font-size:12.5px}
 .app .table-wrap table td.ui-col-description{min-width:180px}
 .app .ceo-report-paper{padding:12px}
 .app .ceo-header{gap:10px}
 .app .ceo-header img{height:54px;width:54px}
 .app .ceo-header h3{font-size:15px}
 .ui-settings-jump{padding:12px}
}
@media(max-width:380px){
 .topbar{padding:10px 11px}
 .page-title{font-size:19px}
 .delivery-summary-grid,.route-detail-kpis,.detail-grid,.modal-card .detail-grid{grid-template-columns:minmax(0,1fr)}
 .card{padding:12px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}
@media print{
 .sidebar,.ui-nav-toggle,.ui-nav-scrim,.topbar,.footer-credit{display:none!important}
 .app{display:block}.content{padding:0;max-width:none}.card{box-shadow:none;break-inside:avoid}
 .table-wrap,.ceo-table-wrap{max-height:none!important;overflow:visible!important}
}
/* Correct legacy small-screen sidebar and header rules regardless of old media order. */
@media(max-width:1024px){.sidebar{flex-direction:column}}
@media(max-width:760px){.topbar>div:first-of-type{flex:1 1 calc(100% - 62px)}}
/* Compact, balanced mobile metrics instead of stacking every small number card. */
@media(max-width:560px){
 .ops-command-metrics,.ops-readiness-grid,.grid4{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .ops-mini-metric,.ops-status-card{padding:12px}
 .ops-mini-metric b,.ops-status-value{font-size:clamp(19px,5.4vw,23px)}
 .top-actions>.phase-select,.top-actions>.btn{grid-column:span 1}
}

/* Sidebar toggle v1.1 — desktop collapses to an icon rail; mobile still uses the drawer. */
.app {transition:grid-template-columns .2s ease}
.ui-nav-toggle{display:inline-flex;position:relative;flex:0 0 42px;box-shadow:0 1px 2px rgba(20,42,60,.04);transition:background .15s ease,border-color .15s ease}
.ui-nav-toggle:hover{background:#edf5f4;border-color:#a3cfc8;color:var(--ui-teal-dark)}
.ui-nav-toggle:active{background:#dff0eb}
.ui-nav-toggle .ui-icon-drawer,.ui-nav-toggle .ui-icon-panel-closed{display:none}
.ui-nav-toggle .ui-icon-panel-open{display:block}
.ui-sidebar-tooltip{position:fixed;z-index:9999;max-width:min(260px,calc(100vw - 110px));padding:9px 12px;border-radius:9px;background:#14283f;border:1px solid #34506b;color:#fff;font-size:13px;font-weight:650;line-height:1.3;box-shadow:0 9px 25px rgba(10,28,45,.25);pointer-events:none;opacity:0;visibility:hidden;transform:translateY(3px);transition:opacity .13s ease,transform .13s ease,visibility .13s ease}
.ui-sidebar-tooltip.is-visible{opacity:1;visibility:visible;transform:translateY(0)}
@media(min-width:1025px){
 .app.ui-sidebar-collapsed{grid-template-columns:78px minmax(0,1fr)}
 .app.ui-sidebar-collapsed .sidebar{padding:16px 8px 12px}
 .app.ui-sidebar-collapsed .sidebar .brand{padding:5px 0 17px;margin-bottom:8px;display:flex;align-items:center;justify-content:center}
 .app.ui-sidebar-collapsed .sidebar .brand-logos{margin:0;justify-content:center;gap:0}
 .app.ui-sidebar-collapsed .sidebar .brand-logos img{width:37px;max-width:37px;height:37px;padding:4px}
 .app.ui-sidebar-collapsed .sidebar .brand-logos img+img{display:none}
 .app.ui-sidebar-collapsed .sidebar .brand-title,
 .app.ui-sidebar-collapsed .sidebar .brand-sub,
 .app.ui-sidebar-collapsed .sidebar .nav-label,
 .app.ui-sidebar-collapsed .sidebar .nav-section,
 .app.ui-sidebar-collapsed .sidebar .sidebar-user,
 .app.ui-sidebar-collapsed .sidebar .sidebar-role,
 .app.ui-sidebar-collapsed .sidebar .project-credit{display:none!important}
 .app.ui-sidebar-collapsed .sidebar .nav-item{min-width:0;width:100%;min-height:46px;padding:10px 0;margin:3px 0;border-radius:10px;justify-content:center;gap:0}
 .app.ui-sidebar-collapsed .sidebar .nav-icon{width:24px;font-size:20px;margin:0}
 .app.ui-sidebar-collapsed .sidebar .nav-section+.nav-item{margin-top:18px}
 .app.ui-sidebar-collapsed .sidebar .nav-item.active{box-shadow:inset 3px 0 0 #209a8a}
 .app.ui-sidebar-collapsed .sidebar .sidebar-footer{padding:11px 0 5px}
 .app.ui-sidebar-collapsed .sidebar .sidebar-footer .nav-item{margin-top:4px!important}
 .app.ui-sidebar-collapsed .ui-icon-panel-open{display:none}
 .app.ui-sidebar-collapsed .ui-icon-panel-closed{display:block}
}
@media(max-width:1024px){
 /* Keep the existing mobile menu behavior; the toggle is always visible. */
 .ui-nav-toggle .ui-icon-drawer{display:block}
 .ui-nav-toggle .ui-icon-panel-open,.ui-nav-toggle .ui-icon-panel-closed{display:none}
 .ui-sidebar-tooltip{display:none}
}
@media print{.ui-sidebar-tooltip{display:none!important}}
