/**
 * PR348 — Clock-Out Correction Flow
 * TradeRail Field Portal
 * Brand: Primary Orange #FF6B00 | Wordmark Dark #1A1A2E
 * No emoji, SVG icons only, ES5/no-class constraint applies to JS only.
 */

/* ─── Modal Overlay ──────────────────────────────────────────────────────────── */

.pr348-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10500;
  padding: 16px;
  box-sizing: border-box;
}

/* ─── Modal Box ─────────────────────────────────────────────────────────────── */

.pr348-modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(26, 26, 46, 0.22);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Modal Header ──────────────────────────────────────────────────────────── */

.pr348-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: #1A1A2E;
  border-bottom: 2px solid #FF6B00;
}

.pr348-modal-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.pr348-modal-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.pr348-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.pr348-modal-close svg path {
  stroke: #aaa;
}

.pr348-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pr348-modal-close:hover svg path {
  stroke: #fff;
}

/* ─── Modal Body ────────────────────────────────────────────────────────────── */

.pr348-modal-body {
  padding: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pr348-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pr348-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555;
}

.pr348-static-value {
  font-size: 14px;
  color: #1A1A2E;
  background: #f4f4f7;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 500;
}

.pr348-input,
.pr348-select,
.pr348-textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  color: #1A1A2E;
  background: #fafafa;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 9px 10px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.pr348-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.pr348-input:focus,
.pr348-select:focus,
.pr348-textarea:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
  background: #fff;
}

.pr348-textarea {
  resize: vertical;
  min-height: 68px;
}

/* ─── Modal Footer ──────────────────────────────────────────────────────────── */

.pr348-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 16px;
}

.pr348-btn-secondary {
  background: none;
  border: 1.5px solid #ddd;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.pr348-btn-secondary:hover {
  background: #f4f4f7;
  border-color: #bbb;
}

.pr348-btn-primary {
  background: #FF6B00;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.pr348-btn-primary:hover {
  background: #e05e00;
}

.pr348-btn-primary:active {
  transform: scale(0.97);
}

/* Second-tap confirm state */
.pr348-btn-confirm {
  background: #1A1A2E;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 2px #FF6B00;
}

.pr348-btn-confirm:hover {
  background: #2d2d4e;
}

.pr348-btn-confirm:active {
  transform: scale(0.97);
}

/* ─── Confirm hint ──────────────────────────────────────────────────────────── */

.pr348-confirm-hint {
  min-height: 20px;
  font-size: 12px;
  text-align: center;
  padding: 0 18px 12px;
  color: transparent;
  transition: color 0.15s;
}

.pr348-confirm-hint--active {
  color: #FF6B00;
  font-weight: 600;
}

.pr348-confirm-hint--warn {
  color: #c0392b;
  font-weight: 600;
}

/* ─── Correction Button (injectable into T&A dashboard row) ─────────────────── */

.pr348-correction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid #FF6B00;
  color: #FF6B00;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  padding: 5px 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.pr348-correction-btn:hover {
  background: #FF6B00;
  color: #fff;
}

.pr348-correction-btn:active {
  opacity: 0.85;
}

/* ─── TRai Insight Bar ───────────────────────────────────────────────────────── */

.pr348-trai-bar {
  background: linear-gradient(90deg, #1A1A2E 0%, #2b2b4e 100%);
  border-left: 3px solid #FF6B00;
  border-radius: 6px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  margin: 8px 0;
}

.pr348-trai-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr348-trai-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pr348-trai-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .pr348-modal-box {
    max-width: 100%;
    border-radius: 8px;
  }

  .pr348-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .pr348-btn-secondary,
  .pr348-btn-primary,
  .pr348-btn-confirm {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
