/* look.css: the TAG Look Guide applied to Mill Tickets (Option B, Oct 2026).
   Mill Tickets keeps its own colors. This file only changes sizes, the phone
   layout (tabs along the bottom, chosen by role) and lists shown as cards. */

/* ---------- every screen size ---------- */
/* Field text 17 so a phone does not zoom in when you tap a field. */
.field input,.field select,.field textarea,
.list-row input,.list-row select,.bulk-add input,.bulk-add select{font-size:17px}
.btn{min-height:44px}
.phone-only{display:none}
.showall-row{margin:12px 0 4px}
table.sched tr.noquota td{opacity:.75}

/* Help page (TAG Look Guide Help rule) */
.help-title{margin:4px 0 0;font-size:24px}
.help-for{margin:0;color:var(--muted);font-size:15px}
.help-steps{margin:0;padding:0 0 0 26px;font-size:17px;line-height:1.45}
.help-steps li{margin-top:10px}
.help-stuck{margin:6px 0 0;font-weight:700;font-size:17px}
.help-others{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.help-others-lbl{font-size:14px;font-weight:600;color:var(--muted)}
.help-others .btn{width:100%;min-height:48px;justify-content:flex-start}

/* ---------- phone ---------- */
@media (max-width:760px){
  body{font-size:17px;padding-inline:12px;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 96px)}

  /* top bar: app name on the left, Log out on the right */
  .top{padding-block:12px 10px;gap:8px 12px}
  .brand h1{font-size:24px}
  .who{width:100%;margin-left:0;flex-wrap:wrap;font-size:14px}
  .who #whoName{font-weight:600;color:var(--ink)}
  .who::before{content:"";order:1;flex-basis:100%}
  .who .btn.small{order:2;flex:1 1 0;min-height:44px;padding:8px 10px;font-size:15px;white-space:nowrap}
  .who #pwBtn{flex-grow:1.5}

  /* tabs along the bottom, 5 at most; each person only sees their own */
  .tabs{position:fixed;left:0;right:0;bottom:0;z-index:15;margin:0;gap:0;
    background:var(--surface);border-top:1px solid var(--line);border-bottom:0;overflow:visible;
    padding-bottom:env(safe-area-inset-bottom,0px);box-shadow:0 -4px 16px rgba(0,0,0,.08)}
  .tab{flex:1 1 0;min-width:0;min-height:62px;padding:8px 2px;margin:0;border:0;
    border-top:4px solid transparent;font-size:17px;line-height:1.05;white-space:normal;text-align:center;letter-spacing:.02em;overflow:hidden}
  .tab[aria-selected="true"]{color:var(--accent);border-top-color:var(--accent);background:var(--accent-soft)}
  /* Reports opens from History on a phone, so it has no tab of its own (company logins keep it) */
  body:not([data-role="company"]) #tab-reports{display:none}
  body[data-tab="reports"]:not([data-role="company"]) #tab-history{color:var(--accent);border-top-color:var(--accent);background:var(--accent-soft)}
  body[data-role="company"] .tabs{display:none}
  body[data-role="company"] #toHistory{display:none!important}
  .phone-only{display:inline-flex;align-items:center;justify-content:center}

  /* buttons: main buttons full width and 52 tall; small ones at least 44 */
  .btn{min-height:48px;font-size:17px}
  .btn.small{min-height:44px;font-size:15px}
  .actions{display:flex;flex-direction:column;gap:10px}
  .actions .btn,.signin-panel .btn.primary,.pw-modal .btn,#qEditBtn,#rPdf,#rCsv,#csvBtn,#toReports,#toHistory,#showAllMills{width:100%;min-height:52px;font-size:18px;font-weight:700}
  .field label{font-size:14px}
  .field input,.field select,.list-row input,.list-row select,.bulk-add input,.bulk-add select{min-height:48px}
  .list-row select{background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:8px;width:100%;min-width:0}
  .hint,.sub{font-size:14px}
  .row{grid-template-columns:minmax(0,1fr)}
  .combo-list{font-size:17px}
  .combo-list li{padding:10px 8px}

  /* week bar */
  .weekbar{gap:8px}
  .weekbar h2{width:100%;font-size:22px;order:-1}
  .weekbar .btn.small{flex:1 1 28%}
  .weekbar .sp{display:none}
  #view-drivers .weekbar .btn:not(.small){flex:1 1 28%;font-size:16px;padding:8px 6px}

  /* filters stack; search on its own line */
  .filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
  .filters .grow,#toHistory,#rPdf,#rCsv{grid-column:1/-1}
  .filters>span[style]{display:none}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}

  /* lists become cards (History, Reports) */
  .tablewrap{background:none;border:0;overflow:visible}
  table.hist,table.mini{min-width:0;display:block;font-size:16px}
  table.hist thead,table.mini thead{display:none}
  table.hist tbody,table.mini tbody,table.mini tfoot{display:flex;flex-direction:column;gap:10px}
  table.mini tfoot{margin-top:10px}
  table.hist tr,table.mini tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;
    background:var(--surface);border:1px solid var(--line);border-left:6px solid var(--good);border-radius:8px;padding:12px 14px}
  table.hist tr.void{border-left-color:var(--line)}
  table.mini tr{border-left-color:var(--accent)}
  table.mini tfoot tr{border-left-color:var(--ink);background:var(--surface-2)}
  table.hist td,table.mini td{display:grid;grid-template-columns:auto minmax(0,1fr);gap:0 12px;padding:0;border:0;grid-column:1/-1;text-align:right}
  table.hist td[data-label]::before,table.mini td[data-label]::before{content:attr(data-label);grid-column:1;grid-row:1/span 2;align-self:start;text-align:left;color:var(--muted);font-size:14px;font-weight:600;padding-top:2px}
  table.hist td[data-label]>*,table.mini td[data-label]>*{grid-column:2}
  table.hist td .sub{font-size:14px}
  table.hist td.c-no,table.mini td.c-no{grid-column:1;display:block;text-align:left;font:700 20px/1.2 var(--f-mono)}
  table.mini td.c-no{font:700 19px/1.2 var(--f-display);text-transform:uppercase}
  table.hist td.c-status{grid-column:2;grid-row:1;display:flex;justify-content:flex-end;align-items:center;gap:6px}
  table.mini td.c-empty{display:none}
  table.hist td.empty{display:block;grid-column:1/-1}
  table.hist tr:has(td.empty){border-left-color:var(--line)}
  table.hist tr.rowlink:hover td{background:none}
  .pill{font-size:13px}
  .rep-grid{grid-template-columns:minmax(0,1fr)}
  .rep-head h2{font-size:22px}

  /* Schedule: one card per mill, one line per day */
  .sched-wrap{background:none;border:0;overflow:visible}
  table.sched{min-width:0;display:block}
  table.sched thead{display:none}
  table.sched tbody{display:flex;flex-direction:column;gap:10px}
  table.sched tr{display:block;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:12px 14px}
  table.sched td{display:flex;align-items:center;justify-content:space-between;gap:12px;border:0;border-top:1px solid var(--line);padding:8px 0;min-width:0;text-align:left}
  table.sched td:first-child{border-top:0;padding-top:0;display:block}
  table.sched td[data-label]::before{content:attr(data-label);font-weight:600;color:var(--muted);font-size:15px;flex:none}
  table.sched td.todaycol::before{color:var(--ink)}
  table.sched td.closed{background:none}
  table.sched td.closed .lbl{font-size:13px}
  table.sched .cell{flex-direction:row;align-items:center;gap:10px}
  table.sched .bar{width:90px}
  table.sched td.tot{border-top:2px solid var(--line)}
  table.sched td.tot .cell{flex-wrap:wrap;justify-content:flex-end}
  .mname{font-size:20px}
  .mrule{font-size:14px}
  .legend-row{font-size:14px}

  /* quota editor */
  .qrow{grid-template-columns:minmax(0,1fr)}
  .days label{min-height:44px;min-width:44px}

  /* Drivers tab */
  .d-tab{min-height:56px}
  .d-chip{min-height:44px;font-size:17px}
  .d-chip button{width:44px;min-height:44px;font-size:22px}
  .d-pick,.d-toggle{min-height:48px;font-size:17px}
  .d-cards{grid-template-columns:minmax(0,1fr)}
  .d-name{font-size:20px}
  .d-rule,.d-note,.d-sub{font-size:14px}

  /* ticket drawer, messages and settings */
  .drawer{width:100%}
  .toast{bottom:calc(env(safe-area-inset-bottom,0px) + 80px)}
  .list-row .x{min-width:44px;min-height:44px}
  .settings{grid-template-columns:minmax(0,1fr)}
  .panel{padding:16px}
}
