/* portal.css — look of the e-report (portal.html): top bar, menu, login box,
   buttons and forms. It does not need any of the old css files.
   On phones the menu folds away behind the ☰ Menu button. */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:#f0f3f9;color:#1a2140;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:16px;line-height:1.45;overflow-x:hidden}
img{max-width:100%}

/* ---------- top bar ---------- */
.header{position:sticky;top:0;z-index:1000;background:#1a365d;color:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18);padding:6px 12px 8px;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.header sup{order:9;font-size:11px;opacity:.6;align-self:flex-start}
.header #logoName{order:1;display:flex;align-items:center;gap:8px;font-size:18px;font-weight:700;margin-right:auto;min-width:0}
.header #logoName img{height:36px!important;width:auto;background:#fff;border-radius:6px;padding:2px;flex:none}
.header #welcomUser{order:2;font-weight:500;font-size:14px;opacity:.9}
.header #welcomUser:empty{display:none}
.header .menuBtn{order:3;display:none;align-items:center;gap:6px;background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.35);border-radius:9px;padding:8px 12px;font:inherit;font-weight:600;font-size:15px;cursor:pointer}
.header .closerBtn{order:4;cursor:pointer;font-size:15px;padding:6px 8px;border-radius:8px;line-height:1;background:rgba(255,255,255,.12)}
.header .closerBtn:hover{background:rgba(255,255,255,.25)}

/* the menu: a row of buttons on computers */
#menuGrid{order:5;flex-basis:100%;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}
#menuGrid .grid-item{margin:0;padding:0}
#menuGrid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:74px;height:100%;padding:6px 8px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;font:inherit;font-size:12.5px;font-weight:600;line-height:1.2;cursor:pointer;text-align:center;margin:0;width:auto}
#menuGrid button:hover,#menuGrid button:focus-visible{background:rgba(255,255,255,.22)}
#menuGrid button br{display:block}

/* phones and small tablets: hide the menu behind ☰ Menu */
@media (max-width:820px){
  .header{padding:6px 10px}
  .header #logoName{font-size:16px}
  .header #logoName img{height:30px!important}
  .header #welcomUser{order:6;flex-basis:100%;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .header .menuBtn{display:inline-flex}
  .header sup{display:none}
  #menuGrid{display:none;max-height:calc(100vh - 110px);overflow-y:auto;-webkit-overflow-scrolling:touch;padding:6px 0 4px}
  .header.open #menuGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:6px}
  #menuGrid button{width:100%;min-width:0;padding:10px 4px;font-size:13px}
}
@media (max-width:380px){ .header #logoName{font-size:14.5px} }

/* ---------- page area ---------- */
#content{padding-top:14px!important;padding-bottom:40px!important}
#content img{height:auto}
@media (max-width:600px){
  #content{padding:10px 10px 40px!important}
  #content h2{font-size:19px!important}
  .card{padding:12px!important}
  .tbl{font-size:13px!important}
  .tbl th,.tbl td{padding:6px 5px!important}
  .sheet input.mk{width:64px!important}
  .toolbar>*{max-width:100%}
  .toolbar select,.toolbar input:not([type=checkbox]):not([type=radio]){flex:1 1 140px;min-width:0}
}
/* wide tables scroll sideways inside their box instead of stretching the page */
.tblwrap{max-width:100%}
#content table{max-width:100%}
#content pre{white-space:pre-wrap;word-break:break-word}

/* ---------- forms and buttons (default look) ---------- */
:where(input:not([type=checkbox],[type=radio],[type=file]),select,textarea){width:100%;padding:9px 10px;border:1px solid #c6cde0;border-radius:8px;font:inherit;font-size:16px;background:#fff;color:inherit;margin:3px 0}
.toolbar :where(input,select){width:auto;max-width:100%}
:where(input[type=file]){max-width:100%;font-size:14px;margin:6px 0}
:where(input,select,textarea):focus,textarea:focus{outline:2px solid #2b6cb0;outline-offset:0;border-color:transparent}
:where(button){font:inherit;cursor:pointer;border-radius:9px;border:1px solid #1a365d;background:#fff;color:#1a365d;padding:8px 14px;font-weight:600;font-size:14px;margin:3px 2px}
:where(button):disabled{opacity:.55;cursor:not-allowed}
.error{color:#b42318;font-size:14px;margin-top:8px;clear:both}

/* ---------- login box (and any other pop-up box) ---------- */
.modal{position:fixed;z-index:2000;left:50%;top:76px;transform:translateX(-50%);width:min(440px,calc(100vw - 24px));max-height:calc(100vh - 96px);overflow:auto;background:#fff;border-radius:14px;padding:18px 18px 16px;box-shadow:0 0 0 100vmax rgba(10,20,45,.45),0 18px 40px rgba(0,0,0,.3)}
.modal h3{margin:0 0 10px;font-size:20px}
.modal .closerBtn{float:right;cursor:pointer;font-size:14px;padding:4px 6px}
.modal form button{min-width:96px;padding:10px 14px}
.modal form button[type=submit]{background:#1a365d;color:#fff}
#loginModal input[type=password]{width:calc(100% - 44px);display:inline-block}
.toggle-btn{display:inline-block;width:38px;text-align:center;cursor:pointer;font-size:20px;vertical-align:middle;user-select:none}
.tabs button{background:#fff;color:#1a365d;border:1px solid #1a365d}
@media (max-width:600px){ .modal{top:62px;max-height:calc(100vh - 74px)} }

/* print: never print the bar or menu */
@media print{ .header,.modal{display:none!important} body{background:#fff} }
