/* レポワン – 現場報告書 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ══════════════════════════════════════
   Design Tokens  (shadcn/ui · zinc scale)
══════════════════════════════════════ */
:root {
  /* Surface */
  --rp-bg:            #fafafa;   /* zinc-50  */
  --rp-surface:       #ffffff;
  --rp-surface-soft:  #f4f4f5;   /* zinc-100 */
  --rp-surface-muted: #e4e4e7;   /* zinc-200 */

  /* Border */
  --rp-border:        #e4e4e7;   /* zinc-200 */
  --rp-border-strong: #a1a1aa;   /* zinc-400 */

  /* Text */
  --rp-text-main:     #09090b;   /* zinc-950 */
  --rp-text-body:     #3f3f46;   /* zinc-700 */
  --rp-text-muted:    #71717a;   /* zinc-500 */
  --rp-text-subtle:   #a1a1aa;   /* zinc-400 */

  /* Functional (kept minimal) */
  --rp-success-bg:    #f0fdf4;
  --rp-success-text:  #166534;
  --rp-success-border:#bbf7d0;
  --rp-error-bg:      #fff1f2;
  --rp-error-text:    #9f1239;
  --rp-error-border:  #fecdd3;
  --rp-warn-bg:       #fefce8;
  --rp-warn-text:     #854d0e;
  --rp-warn-border:   #fef08a;

  /* Shape */
  --rp-radius-sm:     6px;
  --rp-radius-md:     8px;
  --rp-radius-lg:     12px;
  --rp-radius-full:   9999px;

  /* Shadow (very subtle – shadcn style) */
  --rp-shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --rp-shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --rp-shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);

  --rp-transition: 150ms ease;
}

/* ══════════════════════════════════════
   Base
══════════════════════════════════════ */
.rp-app *,
.rp-login-wrapper * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.rp-app {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--rp-text-body);
  background: var(--rp-bg);
  min-height: 100vh;
}

/* ══════════════════════════════════════
   Header
══════════════════════════════════════ */
.rp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--rp-text-main);
  border-bottom: 1px solid #27272a;
}
.rp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  max-width: 720px;
  margin: 0 auto;
}
.rp-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}
.rp-header-user {
  font-size: 12px;
  color: #a1a1aa;
  display: flex;
  gap: 8px;
  align-items: center;
}
.rp-logout {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid #3f3f46;
  border-radius: var(--rp-radius-sm);
  letter-spacing: 0.01em;
  transition: color var(--rp-transition), border-color var(--rp-transition);
}
.rp-logout:hover { color: #ffffff; border-color: #71717a; }

.rp-back-btn {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--rp-radius-sm);
  display: flex;
  align-items: center;
  letter-spacing: 0.01em;
  transition: color var(--rp-transition), background var(--rp-transition);
}
.rp-back-btn:hover { color: #ffffff; background: #27272a; }

/* ══════════════════════════════════════
   Content
══════════════════════════════════════ */
.rp-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ══════════════════════════════════════
   Section Card
══════════════════════════════════════ */
.rp-section {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
  padding: 24px;
  margin-bottom: 12px;
}
.rp-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--rp-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 20px;
  padding-bottom: 12px;
  background: none;
  border-bottom: 1px solid var(--rp-border);
  border-radius: 0;
}
.articleBody .rp-section-title { margin-top: 0; }

.rp-section .rp-section-title {
  color: #ffffff !important;
  margin: -24px -24px 20px !important;
  padding: 11px 24px !important;
  background: #0073aa !important;
  border-bottom: none !important;
  border-radius: 12px 12px 0 0 !important;
}

/* ══════════════════════════════════════
   Fields
══════════════════════════════════════ */
.rp-field { margin-bottom: 16px; }
.rp-field:last-child { margin-bottom: 0; }
.rp-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .rp-field-row { grid-template-columns: 1fr; }
}
.rp-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--rp-text-main);
  margin-bottom: 6px;
}
.rp-required::after {
  content: ' *';
  color: var(--rp-text-muted);
}
.rp-input {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
  font-size: 15px;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--rp-text-main);
  background: var(--rp-surface);
  outline: none;
  transition: border-color var(--rp-transition), box-shadow var(--rp-transition);
  -webkit-appearance: none;
  box-shadow: var(--rp-shadow-xs);
}
.rp-input::placeholder { color: var(--rp-text-subtle); }
.rp-input:hover:not(:focus) { border-color: var(--rp-border-strong); }
.rp-input:focus {
  border-color: var(--rp-text-main);
  box-shadow: 0 0 0 2px rgba(9,9,11,.08);
}
.rp-textarea {
  height: auto;
  min-height: 110px;
  resize: none;
  line-height: 1.7;
}
.rp-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2371717a'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 011.06 0L10 11.94l3.72-3.72a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0L5.22 9.28a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

/* ══════════════════════════════════════
   Photos
══════════════════════════════════════ */
.rp-photo-section { margin-bottom: 22px; }
.rp-photo-section:last-child { margin-bottom: 0; }
.rp-photo-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.rp-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.rp-photo-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: var(--rp-radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--rp-border);
}
.rp-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rp-photo-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 0 var(--rp-radius-md) 0 var(--rp-radius-md);
  background: rgba(9,9,11,.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--rp-transition);
}
.rp-photo-remove:hover { background: rgba(9,9,11,.9); }
.rp-photo-add {
  width: 88px;
  height: 88px;
  border-radius: var(--rp-radius-md);
  border: 1px dashed var(--rp-border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--rp-surface);
  color: var(--rp-text-subtle);
  font-size: 22px;
  transition: border-color var(--rp-transition), background var(--rp-transition), color var(--rp-transition);
}
.rp-photo-add:hover {
  border-color: var(--rp-text-main);
  background: var(--rp-surface-soft);
  color: var(--rp-text-body);
}
.rp-file-input { display: none; }
.rp-photo-grid-view .rp-photo-thumb {
  width: 96px;
  height: 96px;
}

/* ══════════════════════════════════════
   Buttons
══════════════════════════════════════ */
.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--rp-radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--rp-transition), box-shadow var(--rp-transition), opacity var(--rp-transition);
  white-space: nowrap;
  -webkit-appearance: none;
  user-select: none;
}
.rp-btn:active { opacity: .88; }

/* Filled black (primary) */
.rp-btn-primary {
  background: var(--rp-text-main);
  color: #ffffff;
  border-color: var(--rp-text-main);
  box-shadow: var(--rp-shadow-xs);
}
.rp-btn-primary:hover {
  background: #27272a;
  border-color: #27272a;
  color: #ffffff;
  box-shadow: var(--rp-shadow-sm);
}

/* Outline (secondary) */
.rp-btn-outline {
  background: var(--rp-surface);
  color: var(--rp-text-main);
  border-color: var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
}
.rp-btn-outline:hover {
  background: var(--rp-surface-soft);
  border-color: var(--rp-border-strong);
  box-shadow: var(--rp-shadow-sm);
}

/* Destructive */
.rp-btn-danger {
  background: var(--rp-surface);
  color: var(--rp-error-text);
  border-color: var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
}
.rp-btn-danger:hover {
  background: var(--rp-error-bg);
  border-color: var(--rp-error-border);
}

/* LINE (brand color – exception) */
.rp-btn-line {
  background: #06C755;
  color: #fff;
  border-color: #06C755;
}
.rp-btn-line:hover {
  background: #05b34c;
  border-color: #05b34c;
  color: #fff;
  box-shadow: var(--rp-shadow-sm);
}

.rp-btn-large { height: 48px; padding: 0 28px; font-size: 15px; }
.rp-btn-sm    { height: 34px; padding: 0 13px; font-size: 12px; }
.rp-btn-block { display: flex; width: 100%; }

.rp-btn:disabled,
.rp-btn.rp-loading {
  background: var(--rp-surface-soft) !important;
  color: var(--rp-text-subtle) !important;
  border-color: var(--rp-border) !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* ══════════════════════════════════════
   Layouts
══════════════════════════════════════ */
.rp-action-bar { margin-bottom: 16px; }
.rp-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.rp-send-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.rp-input-with-btn {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.rp-input-with-btn .rp-input { flex: 1; }
@media (max-width: 480px) {
  .rp-input-with-btn { flex-direction: column; }
  .rp-input-with-btn .rp-btn { width: 100%; }
}

/* ══════════════════════════════════════
   Report List / Cards
══════════════════════════════════════ */
.rp-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rp-card {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--rp-transition), border-color var(--rp-transition);
}
.rp-card:hover {
  border-color: #d4d4d8;
  box-shadow: var(--rp-shadow-sm);
}
.rp-card-header { padding: 14px 18px 0; }
.rp-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rp-card-date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--rp-text-muted);
}
.rp-card-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--rp-radius-full);
  border: 1px solid transparent;
}
.rp-badge-done {
  background: var(--rp-success-bg);
  color: var(--rp-success-text);
  border-color: var(--rp-success-border);
}
.rp-badge-draft {
  background: var(--rp-surface-soft);
  color: var(--rp-text-muted);
  border-color: var(--rp-border);
}
.rp-card-body { padding: 10px 18px 14px; }
.rp-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--rp-text-main);
  margin: 0 0 3px;
  letter-spacing: -0.01em;
}
.rp-card-sub {
  font-size: 12px;
  color: var(--rp-text-muted);
  margin: 0;
}
.rp-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--rp-border);
  background: var(--rp-surface-soft);
}

/* ══════════════════════════════════════
   Info Table
══════════════════════════════════════ */
.rp-info-table { width: 100%; border-collapse: collapse; }
.rp-info-table th,
.rp-info-table td {
  padding: 11px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--rp-border);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.rp-info-table th {
  width: 86px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rp-text-muted);
  background: var(--rp-surface-soft);
  white-space: nowrap;
}
.rp-info-table tr:last-child th,
.rp-info-table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════
   Text Block
══════════════════════════════════════ */
.rp-text-block {
  font-size: 14px;
  line-height: 1.8;
  color: var(--rp-text-body);
  white-space: pre-wrap;
  word-break: break-all;
}
.rp-text-notes {
  border-left: 2px solid var(--rp-border-strong);
  padding: 10px 14px;
  background: var(--rp-surface-soft);
  border-radius: 0 var(--rp-radius-sm) var(--rp-radius-sm) 0;
}

/* ══════════════════════════════════════
   Status / Messages
══════════════════════════════════════ */
.rp-status-bar {
  padding: 10px 16px;
  border-radius: var(--rp-radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
  border: 1px solid transparent;
}
.rp-status-done {
  background: var(--rp-success-bg);
  color: var(--rp-success-text);
  border-color: var(--rp-success-border);
}
.rp-status-draft {
  background: var(--rp-surface-soft);
  color: var(--rp-text-muted);
  border-color: var(--rp-border);
}

.rp-message {
  padding: 12px 16px;
  border-radius: var(--rp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  border: 1px solid transparent;
}
.rp-msg-success {
  background: var(--rp-success-bg);
  color: var(--rp-success-text);
  border-color: var(--rp-success-border);
}
.rp-msg-error {
  background: var(--rp-error-bg);
  color: var(--rp-error-text);
  border-color: var(--rp-error-border);
}

.rp-notice {
  padding: 11px 14px;
  border-radius: var(--rp-radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.rp-notice-warn {
  background: var(--rp-warn-bg);
  color: var(--rp-warn-text);
  border-color: var(--rp-warn-border);
}

/* ══════════════════════════════════════
   Empty State
══════════════════════════════════════ */
.rp-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
}
.rp-empty-icon { font-size: 40px; margin-bottom: 16px; opacity: .4; }
.rp-empty p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--rp-text-muted);
}

/* ══════════════════════════════════════
   Send Panel
══════════════════════════════════════ */
.rp-send-panel {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-xs);
  padding: 24px;
  margin-top: 12px;
}

/* ══════════════════════════════════════
   Login
══════════════════════════════════════ */
.rp-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rp-bg);
  padding: 24px;
  font-family: 'Noto Sans JP', sans-serif;
}
.rp-login-box {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--rp-border);
  box-shadow: var(--rp-shadow-md);
  padding: 40px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.rp-login-logo { max-height: 60px; max-width: 160px; margin-bottom: 20px; }
.rp-login-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--rp-text-main);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.rp-login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--rp-text-main);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.rp-login-title span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--rp-text-muted);
  letter-spacing: 0.01em;
  margin-top: 8px;
}
.rp-login-desc {
  font-size: 13px;
  color: var(--rp-text-muted);
  margin: 0 0 28px;
  line-height: 1.75;
}

/* ── 新規作成ボタン ── */
.rp-action-bar .rp-btn-primary:hover {
  background: #005f8e !important;
  border-color: #005f8e !important;
}

/* ══════════════════════════════════════
   Spinner / Overlay
══════════════════════════════════════ */
.rp-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rp-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp-upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,9,11,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  flex-direction: column;
  gap: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.02em;
}
.rp-upload-overlay .rp-spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
}
