/* Shared by Hazard Reports and Shutdown Requests (site safety). Brand styles: base.css. */

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; }
.tabs button[aria-selected="true"] { background: var(--mem-navy); border-color: var(--mem-navy); color: #fff; }
.tabs .count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--mem-sunshade); color: var(--mem-navy); font-size: 12px; text-align: center; }

/* Forms */
.safety-form { display: grid; gap: 18px; }
.form-section { display: grid; gap: 12px; padding-top: 4px; }
.form-section > h3 { margin: 0; font-size: 16px; color: var(--mem-navy); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; }
.choice-row input { accent-color: var(--mem-blue); margin: 0; }
.choice-row label:has(input:checked) { border-color: var(--mem-blue); background: var(--mem-blue-soft); color: var(--mem-blue-text); }
.priority-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.priority-cards label { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.priority-cards label b { display: flex; align-items: center; gap: 8px; }
.priority-cards label span { font-size: 13px; color: var(--muted); font-weight: 400; }
.priority-cards input { accent-color: var(--mem-blue); margin: 0; }
.priority-cards label.high { border-left-color: #d64545; }
.priority-cards label.medium { border-left-color: var(--mem-sunshade); }
.priority-cards label.low { border-left-color: var(--mem-blue); }
.priority-cards label:has(input:checked) { background: var(--mem-blue-soft); border-color: var(--mem-blue); }
.priority-cards label.high:has(input:checked) { background: var(--danger-bg); border-color: #d64545; }
.field textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Location picker */
.location-picker { display: grid; gap: 12px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.search-row button { flex: 0 0 auto; }
.loc-results { display: grid; gap: 6px; }
.loc-result { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; background: #fff; color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--mem-blue); border-radius: 10px; box-shadow: none; font-weight: 400; }
.loc-result:hover { background: var(--mem-blue-soft); transform: none; }
.loc-result span { font-size: 13px; color: var(--muted); }
.loc-chosen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--success-bg); color: var(--success-text); font-size: 14px; font-weight: 600; }
button.small { padding: 6px 12px; font-size: 13px; }

/* Photos */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); display: block; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: rgba(11,34,58,.8); color: #fff; font-size: 16px; line-height: 1; box-shadow: none; }
.photo-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px dashed var(--mem-blue); border-radius: 10px; color: var(--mem-blue-text); font-weight: 700; cursor: pointer; background: #fff; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Lists */
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.record-list { display: grid; gap: 10px; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; text-align: left; padding: 12px 14px; background: #fff; color: var(--text); border: 1px solid var(--border); border-left: 5px solid var(--mem-blue); border-radius: 12px; box-shadow: none; font: inherit; cursor: pointer; }
.record:hover { background: var(--mem-blue-soft); transform: none; }
.record.prio-high { border-left-color: #d64545; }
.record.prio-medium { border-left-color: var(--mem-sunshade); }
.record-title { font-weight: 800; overflow-wrap: anywhere; }
.record-meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.record-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: start; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.pill.st-new, .pill.st-awaiting-approval { background: var(--warning-bg); border-color: transparent; color: var(--warning-text); }
.pill.st-sent, .pill.st-sent-to-client, .pill.st-acknowledged, .pill.st-quoted { background: var(--mem-blue-soft); border-color: transparent; color: var(--mem-blue-text); }
.pill.st-fixed, .pill.st-closed, .pill.st-approved-by-client, .pill.st-completed { background: var(--success-bg); border-color: transparent; color: var(--success-text); }
.pill.st-rejected, .pill.st-declined-by-client, .pill.st-cancelled { background: var(--danger-bg); border-color: transparent; color: var(--danger-text); }
.pill.pr-high { background: #d64545; border-color: transparent; color: #fff; }
.empty-state { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; background: #fff; }

/* Detail */
.detail-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.detail-head h2 { margin: 0; font-size: 22px; }
.detail-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14.5px; }
.detail-list dt { color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 520px) { .detail-list { grid-template-columns: 1fr; gap: 2px; } .detail-list dd { margin-bottom: 8px; } }
.action-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.action-box h3 { margin: 0; font-size: 16px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { padding: 8px 12px; border-left: 3px solid var(--mem-blue); background: #fff; border-radius: 0 8px 8px 0; }
.history-meta { margin: 0; font-size: 13px; color: var(--muted); }
.history-meta b { color: var(--text); }
.history-note { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.test-banner { padding: 8px 12px; border-radius: 10px; background: var(--warning-bg); color: var(--warning-text); font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ---- Phone-friendly form layout ---- */
/* Tick boxes and radios inside a .field must not pick up the text-box styling from base.css */
.field input[type="checkbox"], .field input[type="radio"] { width: auto; padding: 0; border: 0; margin: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
fieldset.field > legend, fieldset.field > .legend { font-weight: 700; font-size: 14px; padding: 0; }

/* Sections: a rule between them and a small heading */
.safety-form { gap: 0; }
.safety-form > .form-section { padding: 18px 0; border-top: 1px solid var(--border); }
.safety-form > .form-section:first-child { padding-top: 4px; border-top: 0; }
.safety-form > .form-section > h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mem-blue-text); }
.safety-form > .message, .safety-form > .form-actions { margin-top: 14px; }
.form-grid > .wide, .loc-grid > .wide { grid-column: 1 / -1; }

/* Chips: compact, one line each */
.choice-row label { padding: 8px 13px; font-size: 14px; line-height: 1.2; white-space: nowrap; }

/* Yes / No questions on one line */
.toggle-list { display: grid; gap: 8px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-weight: 700; font-size: 14px; }
.segmented { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.segmented label { position: relative; padding: 7px 14px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label:has(input:checked) { background: var(--mem-navy); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--mem-blue); outline-offset: -2px; }

@media (max-width: 520px) {
  .field input, .field select, .field textarea { padding: 10px 12px; font-size: 16px; }
  .field { gap: 5px; }
  .loc-grid, .form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .loc-grid > :first-child { grid-column: 1 / -1; }
  .priority-cards { grid-template-columns: 1fr; }
  .panel-meta { font-size: 14px; }
  .choice-row { gap: 6px; }
}

/* Photo placeholders while they load */
.photo-loading { background: linear-gradient(90deg, var(--bg) 0%, #e6ecf2 50%, var(--bg) 100%); background-size: 200% 100%; animation: photo-shimmer 1.2s linear infinite; }
@keyframes photo-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .photo-loading { animation: none; } }

/* Location: two ways to find a Monash room (on the map, or building and room lists) */
.loc-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.loc-ways button { padding: 12px 8px; font-size: 15px; font-weight: 800; border-radius: 12px; background: #fff; color: var(--text); border: 2px solid var(--border); box-shadow: none; }
.loc-ways button[aria-pressed="true"] { background: var(--mem-navy); color: #fff; border-color: var(--mem-navy); }
.loc-map { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: 380px; background: #eef2f5; }
.loc-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.loc-lists { display: grid; gap: 10px; }
.loc-lists input[type="search"] { margin-bottom: 6px; }
.loc-lists select { width: 100%; }
@media (max-width: 560px) { .loc-map { height: 62vh; min-height: 320px; } }
