/* ============================================================
   my-report.css — Team Member web report shell
   Field-type styles come from app.css (shared with the template
   editor preview); this file only adds the report shell chrome
   (tabs, shift banner, submit bar, success overlay), scoped under
   #my-report-app so nothing leaks into the rest of the admin UI.
   ============================================================ */

#my-report-app {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

#my-report-app .shift-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #1B2A4A;
  color: #fff;
  padding: 12px 16px;
  flex-wrap: wrap;
}
#my-report-app .shift-banner-name { font-size: 14px; font-weight: 600; }
#my-report-app .shift-banner-date { font-size: 12px; color: #C7D2E4; }
#my-report-app .shift-banner-right { display: flex; align-items: center; gap: 14px; }
#my-report-app .mr-signout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
#my-report-app .mr-signout:hover { background: rgba(255, 255, 255, 0.12); }
#my-report-app .shift-override {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #C7D2E4;
}
#my-report-app .shift-override select {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #3A4A6B;
  background: #24314F;
  color: #fff;
}

#my-report-app .tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #E2E8F0;
}
#my-report-app .tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 11px 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #64748B;
  cursor: pointer;
  white-space: nowrap;
}
#my-report-app .tab-btn:hover { color: #1B2A4A; }
#my-report-app .tab-btn.active {
  color: #1B2A4A;
  border-bottom-color: #3B82E0;
  font-weight: 600;
}

#my-report-app .tab-panel { display: none; flex-direction: column; flex: 1; padding: 16px; }
#my-report-app .tab-panel.active { display: flex; }

/* ---- Shared report-form chrome ----------------------------------------
   report-form.js emits markup styled in the add-in's addin.css, which the
   admin SPA doesn't load. Re-declare the pieces here (scoped) so the web
   report page matches: the template tab strip, the required marker, and the
   per-field error message (hidden until validation reveals it — without this
   default the message shows under every field). */

/* Inner template tab strip (e.g. General / NGR / Lines) */
#my-report-app .template-tab-strip {
  display: flex;
  overflow-x: auto;
  gap: 2px;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 14px;
  scrollbar-width: none;
}
#my-report-app .template-tab-strip::-webkit-scrollbar { display: none; }
#my-report-app .template-tab-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  color: #64748B;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#my-report-app .template-tab-btn:hover { color: #1B2A4A; }
#my-report-app .template-tab-btn.active {
  color: #1B2A4A;
  border-bottom-color: #3B82E0;
  font-weight: 600;
}

#my-report-app .form-label .required-star { color: #DC2626; margin-left: 2px; }
#my-report-app .help-text { font-size: 11px; color: #64748B; margin-top: 3px; }

/* Hidden by default; report-form.js reveals it on validation failure. */
#my-report-app .field-error-msg { font-size: 11px; color: #DC2626; margin-top: 3px; display: none; }
#my-report-app .form-control.error {
  border-color: #DC2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

/* Station picker at the top of the report form */
#my-report-app .station-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #F1F5FB;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 14px;
}
#my-report-app .station-picker-label {
  font-size: 12px;
  font-weight: 600;
  color: #1B2A4A;
  white-space: nowrap;
}
#my-report-app .station-picker-select {
  flex: 1;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #fff;
  color: #1B2A4A;
}
#my-report-app .station-picker-row.error {
  border-color: #DC2626;
  background: #FEF2F2;
}
#my-report-app .station-picker-row.error .station-picker-select {
  border-color: #DC2626;
}

#my-report-app .submit-bar {
  padding: 14px 16px;
  background: #fff;
  border-top: 1px solid #E2E8F0;
}
#my-report-app .draft-status {
  font-size: 12px;
  color: #94A3B8;
  text-align: center;
  margin-bottom: 8px;
  min-height: 16px;
}
#my-report-app .btn-block { display: block; width: 100%; }

#my-report-app .loading-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748B;
  font-size: 13px;
  padding: 28px 0;
  justify-content: center;
}
#my-report-app .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #E2E8F0;
  border-top-color: #1B2A4A;
  border-radius: 50%;
  animation: mr-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes mr-spin { to { transform: rotate(360deg); } }

#my-report-app .field-flag-wrapper-addin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  margin-bottom: 10px;
}
#my-report-app .field-flag-wrapper-addin label { font-size: 13px; color: #334155; }

#success-overlay {
  display: none;               /* report-form.js sets display:flex to show */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  z-index: 999;
}
#success-overlay .success-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
#success-overlay .success-check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #16A34A;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
#success-overlay .success-title { font-size: 16px; font-weight: 700; color: #0F172A; margin-bottom: 6px; }
#success-overlay .success-msg { font-size: 13px; color: #475569; margin-bottom: 18px; }

/* ---- Supervisor station-report rollup ---------------------------------- */
.station-rollup .rollup-summary {
  font-size: 13px;
  font-weight: 600;
  color: #1B2A4A;
  margin-bottom: 12px;
}
.station-rollup .rollup-card {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.station-rollup .rollup-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.station-rollup .rollup-station { font-weight: 700; font-size: 14px; color: #1B2A4A; }
.station-rollup .rollup-by { font-size: 12px; color: #64748B; margin-left: auto; }
.station-rollup .rollup-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.station-rollup .rollup-status-ok    { background: #DCFCE7; color: #166534; }
.station-rollup .rollup-status-draft { background: #FEF3C7; color: #92400E; }
.station-rollup .rollup-status-none  { background: #F1F5F9; color: #64748B; }
.station-rollup .rollup-fields { padding: 12px; display: grid; gap: 10px; }
.station-rollup .rollup-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #64748B;
  margin-bottom: 2px;
}
.station-rollup .rollup-field-value { font-size: 13px; color: #1E293B; }
.station-rollup .rollup-empty { padding: 12px; font-size: 12px; color: #94A3B8; }

/* Team Member mode hides the admin chrome entirely */
body.team-member-mode #sidebar { display: none !important; }
body.team-member-mode #main-content { padding: 24px 16px; }
