/* 村田鉄筋㈱ 出面共有アプリ カスタムスタイル */

html, body { height: 100%; }
body { -webkit-tap-highlight-color: transparent; }

/* ロゴ */
.murata-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.05em;
  box-shadow: 0 2px 6px rgba(22,163,74,.3);
}

/* スクロールバー */
.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

/* 案件状態バッジ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge-before { background:#dbeafe; color:#1e40af; }
.badge-ongoing { background:#dcfce7; color:#166534; }
.badge-done { background:#e5e7eb; color:#4b5563; }
.badge-cancelled { background:#fee2e2; color:#991b1b; }

/* アクティブメニュー */
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 8px;
  color: #4b5563; transition: all .15s; cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.menu-item:hover { background: #f3f4f6; color: #15803d; }
.menu-item.active {
  background: linear-gradient(90deg, #dcfce7, #f0fdf4);
  color: #166534;
  font-weight: 600;
}
.menu-item i { width: 20px; text-align: center; }

/* チャットバブル */
.chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}
.chat-bubble.mine {
  background: #16a34a;
  color: white;
  border-bottom-right-radius: 2px;
}
.chat-bubble.others {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 2px;
}

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
  transition: all .15s; cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #16a34a; color: white; }
.btn-primary:hover:not(:disabled) { background: #15803d; }
.btn-secondary { background: white; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost { background: transparent; color: #4b5563; }
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}

/* フォーム */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.textarea { resize: vertical; min-height: 80px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.label .required {
  color: #dc2626;
  margin-left: 4px;
}

/* カード */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: box-shadow .15s, transform .15s;
}
.card-hover:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

/* モーダル */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: white;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

/* トースト */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: #1f2937; color: white;
  padding: 12px 20px; border-radius: 8px;
  z-index: 100;
  animation: toastIn .3s ease-out;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  font-size: 14px;
}
.toast.error { background: #dc2626; }
.toast.success { background: #16a34a; }
@keyframes toastIn { from { opacity:0; transform: translateY(20px) } to { opacity:1; transform: translateY(0) } }

/* 画像プレビューサムネ */
.thumb {
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: #16a34a; }

/* ライトボックス */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  color: white; font-size: 28px;
  background: rgba(0,0,0,.5);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

/* レイアウト */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
}

/* モバイル */
.mobile-header { display: none; }

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35;
    display: none;
  }
  .sidebar-backdrop.open { display: block; }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky; top: 0; z-index: 30;
  }
  .app-shell { flex-direction: column; }
  .main-content { padding-bottom: 60px; }
}

/* チャット2ペイン */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
}
.chat-list {
  border-right: 1px solid #e5e7eb;
  background: white;
  overflow-y: auto;
}
.chat-detail {
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  overflow: hidden;
}
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-layout.show-detail .chat-list { display: none; }
  .chat-layout:not(.show-detail) .chat-detail { display: none; }
}

/* チャット項目 */
.chat-row {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.chat-row:hover { background: #f8fafc; }
.chat-row.active { background: #f0fdf4; border-left: 3px solid #16a34a; padding-left: 11px; }

/* タブ */
.tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.tab:hover { color: #15803d; }
.tab.active {
  color: #15803d;
  border-bottom-color: #16a34a;
  background: #f0fdf4;
}

/* バッジ未読件数 */
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #dc2626;
  color: white;
  border-radius: 9999px;
  font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px;
  padding: 0 6px;
}

/* ファイル添付プレビュー */
.attach-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}
.attach-card .icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.icon-pdf { background: #fee2e2; color: #b91c1c; }
.icon-excel { background: #dcfce7; color: #166534; }
.icon-word { background: #dbeafe; color: #1e40af; }
.icon-file { background: #f3f4f6; color: #4b5563; }
.icon-zip { background: #fef3c7; color: #92400e; }

/* PCログイン背景 */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #15803d 0%, #166534 50%, #14532d 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

/* ホーム grid */
.summary-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

/* 非表示ヘルパー */
.hide { display: none !important; }
