/* MLSB Ops — internal tool styling. Deliberately plain, fast, readable. */
* { box-sizing: border-box; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.45;
  color: #1c2430; background: #f2f4f6;
}
a { color: #23677e; }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin-bottom: 14px; }
h2 { font-size: 16px; margin: 18px 0 8px; }

.topbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px;
  background: #1c2430; color: #fff; padding: 10px 18px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-weight: 650; letter-spacing: .02em; }
.topbar nav {
  display: flex; gap: 16px;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar a { color: #cfd8e0; text-decoration: none; white-space: nowrap; padding: 4px 0; }
.topbar a:hover { color: #fff; }
.topbar .logout { margin-left: auto; }
.topbar .logout button {
  background: none; border: 1px solid #46525f; color: #cfd8e0;
  border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 13px;
}

.card {
  background: #fff; border: 1px solid #dde3e8; border-radius: 6px;
  padding: 16px 18px; margin-bottom: 16px;
  overflow-x: auto;   /* wide tables scroll inside the card, never the page */
}
.card.narrow { max-width: 380px; margin: 60px auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid #dde3e8; border-radius: 6px; padding: 12px 14px; }
.tile .num { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: 12.5px; color: #55616f; }
.tile.warn { border-color: #c96f1e; } .tile.warn .num { color: #c96f1e; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e6ebef; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #55616f; }
tr:hover td { background: #f7fafb; }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.badge.REQUESTED     { background: #e8ecef; color: #46525f; }
.badge.SCHEDULED     { background: #e0edf3; color: #23677e; }
.badge.DISPATCHED    { background: #dcf0ee; color: #1e6e63; }
.badge.IN_PROGRESS   { background: #fdf0dc; color: #9a6510; }
.badge.ON_HOLD_PARTS { background: #fbe4e1; color: #a33325; }
.badge.COMPLETED     { background: #e2f2e2; color: #2e6d33; }
.badge.CLOSED        { background: #d8dde2; color: #333c46; }
.badge.DRAFT         { background: #e8ecef; color: #46525f; }
.badge.SENT          { background: #e0edf3; color: #23677e; }
.badge.ACCEPTED      { background: #e2f2e2; color: #2e6d33; }
.badge.REJECTED      { background: #fbe4e1; color: #a33325; }
.badge.EXPIRED       { background: #d8dde2; color: #333c46; }
.badge.WARRANTY      { background: #e2f2e2; color: #2e6d33; }
.badge.CONTRACT      { background: #e0edf3; color: #23677e; }
.badge.NONE          { background: #fbe4e1; color: #a33325; }
/* A delegation the technician hasn't opened yet. Loud on purpose — the app is
   how work reaches them, so a new assignment must not read as just another row. */
.badge.NEW           { background: #23677e; color: #fff; }
.card.is-new         { border-left: 4px solid #23677e; }

form p { margin: 10px 0; }
label { font-size: 13px; color: #46525f; }
input[type=text], input[type=date], input[type=password], input[type=search],
select, textarea {
  width: 100%; max-width: 420px; padding: 7px 9px;
  border: 1px solid #c6ced6; border-radius: 4px; font: inherit;
}
.btn {
  display: inline-block; border: 1px solid #c6ced6; background: #fff;
  border-radius: 4px; padding: 7px 14px; font: inherit; cursor: pointer;
  text-decoration: none; color: #1c2430;
}
.btn.primary { background: #23677e; border-color: #23677e; color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.msg { border-radius: 5px; padding: 9px 13px; margin-bottom: 12px; font-size: 14px; }
.msg-success { background: #e2f2e2; color: #2e6d33; }
.msg-info    { background: #e0edf3; color: #23677e; }
.msg-error   { background: #fbe4e1; color: #a33325; }

.sched { table-layout: fixed; min-width: 720px; }
.sched td { height: 64px; font-size: 12.5px; }
.sched .day-today { background: #f2f7f9; }
.sched .job-chip {
  display: block; background: #e0edf3; border-radius: 4px;
  padding: 3px 6px; margin-bottom: 4px; text-decoration: none; color: #1c2430;
}
.sched .job-chip:hover { background: #cfe3ec; }
.muted { color: #55616f; font-size: 13px; }

/* ---------- phone layout ---------- */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  main { padding: 14px 10px 48px; }
  h1 { font-size: 19px; }
  h2 { font-size: 15px; }
  .topbar { gap: 8px 14px; padding: 8px 12px; }
  .topbar nav { gap: 14px; }
  .topbar .logout button { padding: 6px 10px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile .num { font-size: 22px; }
  .card { padding: 12px; }
  .card.narrow { margin: 24px auto; }
  th, td { padding: 7px 8px; }
  /* 16px stops iOS zooming the page on focus; full width stacks form fields */
  input[type=text], input[type=date], input[type=password], input[type=search],
  input[type=file], select, textarea { font-size: 16px; max-width: 100%; }
  .btn { padding: 10px 14px; }
  .btn.small { padding: 7px 10px; }
  .actions { gap: 10px; }
  .sched td { height: 52px; }
}
