/* orders.css
 * 業務依頼(社員画面 index.html/works.html と 管理画面 admin.html/works-admin.html の共用)。
 * 既存の style.css / admin.css の色の変数(--primary 等)をそのまま使い、見た目を揃える。
 * クラス名は既存と衝突しないよう lo- で始める。
 */

/* ===== 状態の札(ステータス) ===== */
.lo-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: bold; white-space: nowrap; vertical-align: middle;
}
.lo-badge.s-未送信 { background: rgba(217, 48, 37, .14); color: var(--danger); }
.lo-badge.s-送信済み { background: rgba(230, 145, 0, .18); color: #b26a00; }
.lo-badge.s-確認済み { background: rgba(26, 115, 232, .14); color: var(--primary); }
.lo-badge.s-作業中 { background: rgba(124, 58, 237, .14); color: #7c3aed; }
.lo-badge.s-完了報告 { background: rgba(30, 142, 62, .16); color: var(--success); }
.lo-badge.s-管理者確認済み { background: var(--secondary); color: var(--text-sub); }
/* 取り消した依頼。作業しなくてよいことが分かるよう、他と違う色で薄く出す */
.lo-badge.s-取消 { background: var(--secondary); color: var(--text-sub); text-decoration: line-through; }
.lo-badge.overdue { background: var(--danger); color: #fff; }

/* ===== 業務依頼状況(件数) ===== */
.lo-status-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
}
.lo-status-head { font-weight: bold; font-size: 14px; margin-bottom: 8px; }
.lo-status-head small { font-weight: normal; color: var(--text-sub); margin-left: 6px; }
.lo-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lo-count {
  text-align: center; border-radius: 8px; background: var(--secondary); padding: 8px 2px;
  font-size: 11px; color: var(--text-sub); cursor: pointer;
}
.lo-count b { display: block; font-size: 20px; color: var(--text); }
.lo-count.has { outline: 2px solid rgba(230, 145, 0, .5); }
.lo-overdue {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-weight: bold; font-size: 14px;
  background: var(--danger); color: #fff; cursor: pointer;
}
.lo-notice {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  background: rgba(30, 142, 62, .12); color: var(--text); border-left: 4px solid var(--success);
}
.lo-notice button { margin-left: 8px; }
.lo-count-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}

/* ===== 業務依頼の一覧(社員画面・管理画面) ===== */
.lo-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.lo-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.lo-item.is-overdue { border-left: 5px solid var(--danger); }
.lo-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lo-item-site { font-weight: bold; font-size: 15px; word-break: break-all; }
.lo-item-content { font-size: 14px; margin-top: 4px; white-space: pre-wrap; word-break: break-all; }
.lo-item-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.lo-empty { color: var(--text-sub); padding: 20px 0; text-align: center; }
.lo-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lo-filter .active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* ===== 業務依頼の詳細 ===== */
.lo-detail h2 { margin: 6px 0 4px; word-break: break-all; }
.lo-detail .lo-content {
  white-space: pre-wrap; word-break: break-all; font-size: 16px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 10px 0;
}
.lo-timeline { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; }
.lo-timeline li { padding: 4px 0 4px 18px; position: relative; color: var(--text-sub); }
.lo-timeline li::before { content: '○'; position: absolute; left: 0; }
.lo-timeline li.done { color: var(--text); }
.lo-timeline li.done::before { content: '●'; color: var(--success); }
.lo-photo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lo-photo-buttons .btn { margin: 0; font-size: 15px; padding: 14px 6px; }
.lo-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.lo-photo { position: relative; aspect-ratio: 1 / 1; background: var(--secondary); border-radius: 8px; overflow: hidden; }
.lo-photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.lo-photo .lo-photo-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-sub); }
.lo-photo .lo-photo-del {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .6); color: #fff; font-size: 14px; cursor: pointer;
}
/* 管理画面の一覧で「本人がまだ確認していない」ことを目立たせる */
.lo-unacked { color: var(--danger); }

/* まだ送信が終わっていない写真。手元の画像をそのまま出し、送信中であることを帯で示す */
.lo-photo.is-sending img { opacity: .55; }
.lo-photo .lo-photo-sending {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; text-align: center;
}
.lo-message { margin-top: 8px; font-size: 14px; }
.lo-message.error { color: var(--danger); font-weight: bold; }
.lo-message.success { color: var(--success); font-weight: bold; }

/* ===== LINE連携 ===== */
.lo-link-status { font-size: 16px; font-weight: bold; padding: 12px; border-radius: 10px; background: var(--secondary); margin: 8px 0; }
.lo-link-status.linked { background: rgba(30, 142, 62, .14); color: var(--success); }
.lo-link-steps { padding-left: 20px; }
.lo-link-steps li { margin-bottom: 14px; }
.lo-link-steps .btn { display: flex; align-items: center; justify-content: center; margin-top: 6px; text-decoration: none; text-align: center; box-sizing: border-box; min-height: 48px; padding-top: 0; padding-bottom: 0; }
.lo-link-code {
  font-family: ui-monospace, Consolas, monospace; font-size: 28px; letter-spacing: 4px; font-weight: bold;
  text-align: center; padding: 10px; margin: 8px 0; background: var(--surface); border: 2px dashed var(--border); border-radius: 10px;
  user-select: all;
}

/* ===== 管理画面: 業務依頼作成フォーム・確認ダイアログ ===== */
.lo-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.lo-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-sub); }
.lo-form .wide { grid-column: 1 / -1; }
.lo-form input, .lo-form select, .lo-form textarea {
  font-size: 15px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); width: 100%; box-sizing: border-box;
}
.lo-form textarea { resize: vertical; min-height: 70px; }
.lo-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lo-modal {
  background: var(--surface); color: var(--text); border-radius: 14px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow: auto; padding: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.lo-modal h3 { margin: 0 0 12px; }
.lo-modal dl { margin: 0; }
.lo-modal dt { font-size: 12px; color: var(--text-sub); margin-top: 10px; }
.lo-modal dd { margin: 2px 0 0; font-size: 16px; white-space: pre-wrap; word-break: break-all; }
.lo-modal .lo-linked { color: var(--success); font-weight: bold; }
.lo-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.lo-modal-actions .btn { flex: 1; margin: 0; }
.lo-table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lo-quota { font-size: 12px; color: var(--text-sub); }
.lo-admin-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); cursor: default; }

@media (max-width: 640px) {
  .lo-form { grid-template-columns: 1fr; }

}
