
/* Final layout and type scale. Declared last on purpose: the earlier style layers each set their own
   sizes and spacing, and this block is the single place that decides what the app finally looks like. */

/* ---- Type scale: 13px body, nothing below 11px ---- */
body{font-size:13px;line-height:1.45}
h2{font-size:18px}
h3{font-size:15px}
.label{font-size:12px}
.metric{font-size:21px}
.btn{padding:8px 13px;font-size:12.5px}
th,td{padding:9px 10px;font-size:12.5px}
.form label{font-size:12px}
.form input,.form select{padding:8px;font-size:13px}
.badge,.v19-live,.v191-pill,.v191-muted,.v19-ot,.v19-file,.form-help,.metric-sub{font-size:11px}
.notice{font-size:12px;padding:10px}
.card{padding:16px}
.metric-card{padding:16px}.metric-card .metric{font-size:24px;margin-top:6px}
.v19-period{font-size:12.5px;padding:10px 12px}

/* ---- Form controls look the same everywhere (date, time, select, text) ---- */
input,select,textarea,button{font-family:inherit}
input:not([type]),input[type=date],input[type=time],input[type=text],input[type=email],input[type=password],input[type=number],input[type=search],select{
  font-size:13px;color:var(--ink);background:#fff;border:1px solid #d0cbc7;border-radius:7px;padding:8px 10px;min-height:36px}
input:focus,select:focus,textarea:focus{outline:2px solid #789889;outline-offset:1px;border-color:#789889}

/* ---- Toolbars: label above its field, everything on one baseline ---- */
.toolbar{align-items:flex-end;gap:10px;margin:14px 0}
.toolbar label{display:flex;flex-direction:column;gap:4px;font-size:11.5px;font-weight:600;color:#47544d}
.toolbar label input,.toolbar label select{min-width:170px;font-weight:400}

/* ---- Pop-up windows sit above the top bar and the sidebar ---- */
.modal{z-index:2000}

/* ---- Rows of action buttons stay on one line ---- */
.btn{white-space:nowrap}
td:has(>.btn:first-child){white-space:nowrap}

/* ---- Top bar and sign-out: always on screen, never floating over content ---- */
header{position:sticky;top:0;z-index:1100}
#marlumAuthBox{display:flex;align-items:center;gap:10px}
.auth-signout{border:1px solid rgba(255,255,255,.55);background:transparent;color:#fff;border-radius:7px;padding:6px 12px;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap}
.auth-signout:hover{background:rgba(255,255,255,.16)}

/* ---- Sidebar: stays in view while the page scrolls; labels wrap instead of being cut off ---- */
#mainNav{width:240px;min-width:240px}
.layout{background:linear-gradient(90deg,#fbfdfc 239px,#dfe8e2 239px,#dfe8e2 240px,transparent 240px)}
#mainNav .nav-label{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.25}
#mainNav .nav-item,#mainNav .nav-group-btn{font-size:13px!important;padding:9px 11px!important}
.nav-submenu button{font-size:12.5px;padding:8px 10px}
@media(min-width:651px){
  #mainNav{position:sticky;top:52px;align-self:flex-start;max-height:calc(100vh - 52px);overflow-y:auto}
}

/* ---- Page heads: title bar spans the page, subtitle sits clearly under it ---- */
.v19-section-head>div:first-child,.marlum-dash-head>div:first-child{flex:1 1 280px;min-width:0}
.marlum-dash-head{align-items:flex-start}
.v19-section-head h2,.marlum-dash-head h2{margin-bottom:8px}
.v19-section-head .label,.marlum-dash-head .label{font-size:12.5px;line-height:1.5;margin:0 0 14px}
.grid,.metric-grid{margin-bottom:14px}
.page>.card+.card{margin-top:14px}

/* ---- Wide tables scroll inside their own box instead of spilling off the page ---- */
#wtsTableWrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:#fffdfc}
#wtsTableWrap table{border:0;border-radius:0;min-width:760px}
.wts-table th{white-space:nowrap}
.wts-table th,.wts-table td{padding:6px}
.wts-date{width:112px;min-height:30px;padding:3px 4px;font-size:11px;margin-top:4px}
.wts-date::-webkit-calendar-picker-indicator{margin-left:0;padding:0}
.wts-extra{width:92px;min-height:30px;padding:4px 8px;font-size:12px}
.wts-day{text-align:center}
.wts-day input{width:18px;height:18px;cursor:pointer}
@media(max-width:1100px){
  table{display:block;overflow-x:auto;max-width:100%}
}

/* ---- Phones ---- */
@media(max-width:650px){
  body{font-size:13px}
  main{padding:12px}
  .layout{background:none}
  .marlum-dash-head>div:first-child,.v19-section-head>div:first-child{flex:none;width:100%}
  .toolbar label,.toolbar label input,.toolbar label select{width:100%;min-width:0}
  .toolbar .btn{flex:1 1 auto}
  th,td{padding:8px 9px;font-size:12px}
  .metric{font-size:18px;overflow-wrap:anywhere}
  .grid,.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric-card{padding:13px}.metric-card .metric{font-size:17px}
  #marlumAuthBox{flex-wrap:nowrap;justify-content:flex-end}
  #marlumAuthName{display:none}
}
.v20-demo-divider{font-size:10px}
#v20WelcomeToast b{font-size:13px}
.v20-toast-sub{font-size:11px}
.v20-role-badge{font-size:10px;padding:2.5px 8px}
.auth-links{font-size:11px}
.marlum-auth-status{font-size:11.5px!important;padding:9px 11px}
.login-mark{width:52px;height:52px;font-size:24px;margin-bottom:14px}
.login-card>h1,.login-card h1{font-size:21px}
.login-card>p.login-intro{font-size:12.5px;margin:0 0 20px!important}
.login-card p{margin:0 0 18px}
.login-section label,.login-card label{font-size:11px;margin:10px 0 4px}
.login-card input{padding:10px}
.login-section .login-note,.login-note{font-size:10.5px!important;margin-top:12px!important}

/* ---- No form control may spill out of its cell or sit on top of its neighbour ---- */
.grid>label,.form>label,.toolbar>label,.modalbox label{min-width:0}
.grid>label,.form>label{display:block}
label>input:not([type=checkbox]):not([type=radio]):not([type=file]),label>select,label>textarea{box-sizing:border-box;width:100%;max-width:100%;min-width:0}
.grid select,.form select{text-overflow:ellipsis}
.checkbox-list{display:flex;flex-wrap:wrap;gap:6px 16px}
.checkbox-list label{display:inline-flex;align-items:center;gap:6px;margin:0;white-space:normal}
