/*
 * css/profile.css — Profile / Company Defaults (profile.html)
 * -----------------------------------------------------------------------
 * PROFILE / COMPANY DEFAULTS PASS. Adapted from the standalone prototype
 * in assets/Tools/rackulate-profile-prototype.html into the real app
 * shell — this file only adds what css/document-modules.css's shared
 * `.docmod-*` panels and css/app-canvas.css's `.ep-field`/`.ep-field-grid`
 * form primitives don't already cover: the logo upload box, the PPE
 * checkbox grid, the summary rows and callouts, and the local-profile
 * badge. Everything here is scoped under a `.profile-` prefix (matching
 * this app's per-page-addition convention — see document-modules.css's
 * own `.docmod-ho-`/`.docmod-jt-` sub-prefixes) so it cannot collide with
 * or restyle any other page.
 *
 * Profile is a global, non-project settings page — not a canvas, not a
 * project document log — so its layout is a plain two-column content
 * area (form panels left, logo/summary/data panels right) inside the
 * same .docmod-main/.docmod-main-inner shell rams.html/handover.html/
 * inspection.html/jobtracker.html already use.
 */

.profile-main-inner { max-width: 1180px; }

.profile-local-badge {
  display: inline-flex; align-items: center; gap: 6px;
  flex: none; white-space: nowrap;
  padding: 7px 12px; border-radius: var(--radius-pill);
  background: var(--ok-soft); border: 1px solid var(--ok-line); color: var(--ok);
  font-size: 0.76em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.profile-local-badge .icon { width: 13px; height: 13px; }

/* ---- two-column layout: form panels / logo+summary+data rail ---- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr); gap: var(--space-4); align-items: start; }
.profile-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

.profile-field-grid { grid-template-columns: 1fr 1fr; }
.profile-field-grid-three { grid-template-columns: repeat(3, 1fr); }
.profile-field-full { grid-column: 1 / -1; }

.profile-hint-note { margin: var(--space-3) 0 0; font-size: 0.8em; color: var(--text-faint); line-height: 1.55; }

/* ---- Standard PPE checkbox grid — reuses the same dark sunken-surface
   language as every other input on this page, just a toggle row instead
   of a text field. ---- */
.profile-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-check {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  background: var(--bg-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.82em; font-weight: 600; color: var(--text-muted);
  cursor: pointer;
}
.profile-check input { width: auto; margin: 0; accent-color: var(--accent); }
/* :has() gives the live highlight in modern browsers; profile.js also
   toggles .is-checked directly on change so this still works correctly
   in anything without :has() support. */
.profile-check:has(input:checked), .profile-check.is-checked { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---- Company Logo box ---- */
.profile-logo-box {
  min-height: 128px; display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); text-align: center;
  background: var(--bg-sunken); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
}
.profile-logo-box img { max-width: 100%; max-height: 92px; display: none; }
.profile-logo-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-faint); font-size: 0.8em; line-height: 1.5; }
.profile-logo-empty .icon { width: 24px; height: 24px; }

.profile-inline-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); position: relative; }
.profile-btn-danger { color: var(--danger); border-color: var(--danger-line); }
.profile-btn-danger:hover { background: var(--danger-soft); }

/* ---- Profile Summary rows ---- */
.profile-summary { display: flex; flex-direction: column; }
.profile-summary-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.84em; }
.profile-summary-row:last-child { border-bottom: none; }
.profile-summary-row span:first-child { color: var(--text-faint); }
.profile-summary-row span:last-child { font-weight: 700; text-align: right; max-width: 60%; word-break: break-word; }

.profile-callout {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 0.8em; line-height: 1.55;
}
.profile-callout strong { color: var(--text); }

/* ---- footer save bar ---- */
.profile-footer-panel { padding: var(--space-3) var(--space-5); }
.profile-footer-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.profile-footer-actions small { color: var(--text-faint); font-size: 0.78em; }
.profile-footer-actions code { font-family: var(--font-mono); background: var(--bg-sunken); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 980px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .profile-field-grid, .profile-field-grid-three { grid-template-columns: 1fr; }
  .profile-checkbox-grid { grid-template-columns: 1fr; }
  .profile-footer-actions { flex-direction: column; align-items: stretch; }
  .profile-footer-actions .btn { width: 100%; }
  /* GLOBAL CONSISTENCY PASS touch-target convention — same 44px minimum
     bump every other phone-width form on this app already applies (see
     document-modules.css's own 640px block). */
  .profile-check { min-height: 44px; }
  .profile-inline-actions .btn { min-height: 40px; }
}
