/* ===================================================================
   楽喜 グループウェア — スマホファースト + デスクトップ対応CSS
   =================================================================== */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
  --primary-green: #0D9E4F;
  --primary-green-hover: #0B8A44;
  --primary-green-light: rgba(13,158,79,0.08);
  --light-green: #4EC078;
  --dark-brown: #2D2319;
  --medium-brown: #6B5E52;
  --light-brown: #A99888;
  --amber-orange: #E8913A;
  --teal: #3B99B1;
  --bg: #F5F6FA;
  --section-bg: #ECEEE4;
  --white: #FFFFFF;
  --border-color: #E2DED9;
  --border-light: #F0EDE8;
  --status-not-started: #A99888;
  --status-in-progress: #3B99B1;
  --status-review: #E8913A;
  --status-done: #0D9E4F;
  --status-hold: #D43D3D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Meiryo', sans-serif;
  --sidebar-width: 256px;
  --header-height: 60px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--dark-brown);
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary-green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-green-hover); }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* PC: max-width: 480px 中央配置（ワイド表示=サイドバーのロールには適用しない）
   admin-wide / member-wide は別途ワイドレイアウトが上書きする。 */
@media (min-width: 481px) {
  body:not(.admin-wide):not(.member-wide) {
    box-shadow: 0 0 30px rgba(0,0,0,0.06);
    min-height: 100vh;
  }
  body:not(.admin-wide):not(.member-wide) .report-fab {
    right: calc(50% - 240px + 20px);
  }
  body:not(.admin-wide):not(.member-wide) .global-chat-fab {
    right: calc(50% - 240px + 16px);
  }
}

/* ===== Login Screen ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #F8F9FC 0%, #EFF1E6 100%);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.login-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 36px;
  width: 420px;
  max-width: 92vw;
  text-align: center;
  border: 1px solid var(--border-light);
}
.login-box .login-logo {
  /* STEP 7 改修③（2026-06-04）: フル版ロゴ（あゆむ/サービス文字込み）を読めるよう枠を拡大。
     正方形枠＋object-fit:contain で文字が切れない。背景は白フラットン済み。 */
  width: 150px; height: 150px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.login-box h2 {
  font-size: 1.2rem;
  color: var(--dark-brown);
  margin-bottom: 8px;
}
.login-box .login-subtitle {
  font-size: 0.85rem;
  color: var(--medium-brown);
  margin-bottom: 28px;
}
.login-box .form-group {
  margin-bottom: 16px;
  text-align: left;
}
.login-box .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--medium-brown);
  margin-bottom: 5px;
}
.login-box .form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--dark-brown);
  background: var(--white);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.login-box .form-group input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.12);
}
.login-box .login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  min-height: 48px;
}
.login-box .login-btn:hover { background: var(--light-green); }
.login-box .login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-box .login-error {
  color: var(--status-hold);
  font-size: 0.82rem;
  margin-top: 12px;
  min-height: 20px;
}
/* バージョン表示（ログイン画面フッター・控えめに） */
.login-box .login-version {
  margin-top: 22px;
  font-size: 0.72rem;
  color: var(--light-brown);
  letter-spacing: 0.02em;
}

/* ===== MFA Form ===== */
.mfa-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.mfa-description {
  font-size: 0.85rem;
  color: var(--medium-brown);
  margin-bottom: 20px;
  line-height: 1.5;
}
.mfa-code-input {
  text-align: center;
  font-size: 1.5rem !important;
  font-weight: 700;
  letter-spacing: 0.5em;
  padding: 14px 16px !important;
}
.mfa-cancel-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--medium-brown);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}
.mfa-cancel-btn:hover {
  background: var(--bg);
  border-color: var(--medium-brown);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248,249,252,0.95);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.3s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--section-bg);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 1rem;
  color: var(--medium-brown);
  font-weight: 500;
}

/* ===== App Header ===== */
.app-header {
  background: var(--white);
  color: var(--dark-brown);
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header .logo-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  /* STEP 7 改修③: 白背景のシンボルロゴがヘッダー（白）に溶けないよう薄いグレー枠で締める。 */
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(13,158,79,0.25);
}
.app-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--dark-brown);
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header-right .admin-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-green-light);
  border: none;
  color: var(--primary-green);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.app-header-right .admin-icon-btn:hover { background: rgba(13,158,79,0.15); }
.app-header-right .logout-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--medium-brown);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
}
.app-header-right .logout-btn:hover { background: var(--bg); border-color: var(--medium-brown); color: var(--dark-brown); }

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 500;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  padding-bottom: var(--safe-bottom);
}
.bottom-nav .nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  min-height: var(--bottom-nav-height);
  background: none;
  border: none;
  color: var(--medium-brown);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav .nav-tab .nav-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
  line-height: 1;
}
.bottom-nav .nav-tab.active {
  color: var(--primary-green);
  font-weight: 700;
}
.bottom-nav .nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary-green);
  border-radius: 0 0 3px 3px;
}

/* ===== Page Container ===== */
.page-container {
  padding: 16px 16px calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
}
.page-container.hidden {
  display: none;
}

/* ===== Page Title ===== */
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
  border: 1px solid var(--border-light);
}
.card:hover { box-shadow: var(--shadow-card-hover); }
.card:active { transform: scale(0.98); }
.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-subtitle {
  font-size: 0.8rem;
  color: var(--medium-brown);
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ===== Home Page ===== */
.home-greeting {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 4px;
}
.home-date {
  font-size: 0.82rem;
  color: var(--medium-brown);
  margin-bottom: 16px;
}
.home-cta {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(13,158,79,0.25);
  min-height: 48px;
}
.home-cta:hover { box-shadow: 0 6px 20px rgba(13,158,79,0.35); transform: translateY(-1px); }
.home-cta:active { transform: scale(0.98); }
.home-cta .cta-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.home-cta .cta-text {
  flex: 1;
}
.home-cta .cta-text .cta-main {
  font-size: 1rem;
  font-weight: 700;
}
.home-cta .cta-text .cta-sub {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 2px;
}
.home-cta .cta-arrow {
  font-size: 1.3rem;
  opacity: 0.8;
}

.home-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* 会議録セクション見出しを一覧への導線にする（STEP 5・ボトムナビから会議録が外れたため） */
.home-section-title-link {
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-section-title-link:active {
  opacity: 0.6;
}
.home-section-title-link .home-section-link-arrow {
  font-size: 0.78rem;
  color: var(--medium-brown);
  font-weight: 600;
}
/* STEP 6 改修④(b): ホームの role="button" 要素のキーボードフォーカス表示。
   :focus-visible でキーボード操作時のみ枠を出す（マウスクリックでは出さない）。 */
.home-cta:focus-visible,
.home-section-title-link:focus-visible,
.home-project-card:focus-visible,
.bulletin-preview-item:focus-visible {
  outline: 2px solid var(--teal, #0D9E4F);
  outline-offset: 2px;
}
.home-project-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}
.home-project-card:active { transform: scale(0.98); }

/* Shift summary on home */
.shift-preview {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.shift-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--section-bg);
}
.shift-preview-item:last-child { border-bottom: none; }
.shift-preview-item .shift-time {
  font-weight: 600;
  color: var(--primary-green);
  min-width: 80px;
}

/* Bulletin preview */
.bulletin-preview {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.bulletin-preview-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--section-bg);
  cursor: pointer;
  transition: var(--transition);
}
.bulletin-preview-item:last-child { border-bottom: none; }
.bulletin-preview-item:active { background: var(--section-bg); }
.bulletin-preview-item .bp-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bulletin-preview-item .bp-meta {
  font-size: 0.75rem;
  color: var(--medium-brown);
}
.bulletin-preview-item.unread .bp-title::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-green);
  flex-shrink: 0;
}

/* ===== Daily Report Page ===== */
.report-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 8px 0;
}
.report-month-nav .month-label {
  font-size: 1rem;
  font-weight: 700;
}
.report-month-nav button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-brown);
  transition: var(--transition);
  min-height: 48px; min-width: 48px;
}
.report-month-nav button:active { background: var(--section-bg); }

.report-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 20px);
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-lg);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 50;
}
.report-fab:active { transform: scale(0.92); }

/* FABがあるページのコンテンツ末尾が隠れないようにする */
#pageReport,
#pageMeetings {
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 80px);
}

.report-list-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid var(--primary-green);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary-green);
}
.report-list-item.draft {
  border-left-color: var(--amber-orange);
}
.report-list-item:active { transform: scale(0.98); }
.report-list-item .rli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.report-list-item .rli-date {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark-brown);
}
.report-list-item .rli-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.report-list-item .rli-status.confirmed {
  background: rgba(0,153,51,0.1);
  color: var(--status-done);
}
.report-list-item .rli-status.draft {
  background: rgba(235,153,55,0.1);
  color: var(--amber-orange);
}
.report-list-item .rli-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.report-list-item .rli-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--section-bg);
  color: var(--medium-brown);
}
.report-list-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--medium-brown);
  font-size: 0.92rem;
}

/* ===== Report Calendar ===== */
.report-calendar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.rcal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--section-bg);
}
.rcal-header-cell {
  padding: 10px 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--medium-brown);
}
.rcal-header-cell:nth-child(1) { color: var(--status-hold); }
.rcal-header-cell:nth-child(7) { color: var(--teal); }
.rcal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.rcal-cell {
  padding: 8px 4px 6px;
  text-align: center;
  min-height: 52px;
  border-bottom: 1px solid var(--section-bg);
  border-right: 1px solid var(--section-bg);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.rcal-cell:nth-child(7n) { border-right: none; }
.rcal-cell:active { background: var(--section-bg); }
.rcal-cell.has-report { cursor: pointer; }
.rcal-cell.other-month { opacity: 0.3; pointer-events: none; }
.rcal-day {
  font-weight: 600;
  font-size: 0.75rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}
.rcal-cell.today .rcal-day {
  background: var(--primary-green);
  color: var(--white);
}
.rcal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.rcal-dot.confirmed {
  background: var(--primary-green);
}
.rcal-dot.draft {
  background: var(--amber-orange);
}
.rcal-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--section-bg);
}
.rcal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--medium-brown);
}
.rcal-legend-item .rcal-dot {
  width: 8px;
  height: 8px;
}

/* ===== Voice Report Creation ===== */
.voice-report-page {
  padding-bottom: 24px;
}
/* Report Date Selector */
.report-date-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.report-date-selector label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-brown);
  white-space: nowrap;
}
.report-date-selector input[type="date"] {
  flex: 1;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  color: var(--dark-brown);
  background: var(--bg);
  max-width: 200px;
}

.voice-recorder-area {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 16px;
}
.voice-recorder-area .recorder-status {
  font-size: 0.88rem;
  color: var(--medium-brown);
  margin-bottom: 16px;
  min-height: 24px;
}
.voice-recorder-area .recorder-timer {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.record-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--status-hold);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: var(--transition);
  min-height: 80px;
}
.record-btn .record-inner {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--status-hold);
  transition: var(--transition);
}
.record-btn.recording .record-inner {
  border-radius: 6px;
  width: 28px; height: 28px;
}
.record-btn:active { transform: scale(0.95); }

.voice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.voice-actions button {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: var(--transition);
}

/* Transcription / structured result */
.transcription-result {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.transcription-result .tr-section {
  margin-bottom: 12px;
}
.transcription-result .tr-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.transcription-result .tr-section-body {
  font-size: 0.88rem;
  color: var(--dark-brown);
  line-height: 1.6;
  white-space: pre-wrap;
}
.transcription-result textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--dark-brown);
  line-height: 1.6;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: var(--transition);
}
.transcription-result textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.12);
}

.confirm-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: var(--transition);
}
.confirm-btn:hover { background: var(--light-green); }
.confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.save-draft-btn {
  width: 100%;
  padding: 12px;
  background: var(--white);
  color: var(--amber-orange);
  border: 2px solid var(--amber-orange);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  margin-top: 10px;
  transition: var(--transition);
}

/* ===== Shift Page ===== */
.shift-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.shift-month-nav .month-label {
  font-size: 1rem;
  font-weight: 700;
}
.shift-month-nav button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; min-width: 48px;
  transition: var(--transition);
}
.shift-month-nav button:active { background: var(--section-bg); }

.shift-calendar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.shift-calendar .cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--section-bg);
}
.shift-calendar .cal-header-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--medium-brown);
}
.shift-calendar .cal-header-cell:nth-child(1) { color: var(--status-hold); }
.shift-calendar .cal-header-cell:nth-child(7) { color: var(--teal); }
.shift-calendar .cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.shift-calendar .cal-cell {
  padding: 6px 4px;
  text-align: center;
  min-height: 60px;
  border-bottom: 1px solid var(--section-bg);
  border-right: 1px solid var(--section-bg);
  font-size: 0.78rem;
  position: relative;
}
.shift-calendar .cal-cell:nth-child(7n) { border-right: none; }
.shift-calendar .cal-cell .cal-day {
  font-weight: 600;
  font-size: 0.72rem;
  margin-bottom: 2px;
}
.shift-calendar .cal-cell.today .cal-day {
  background: var(--primary-green);
  color: var(--white);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shift-calendar .cal-cell.other-month { opacity: 0.3; }
.shift-calendar .cal-cell .shift-badge {
  font-size: 0.62rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0,153,51,0.1);
  color: var(--primary-green);
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shift-calendar .cal-cell .shift-badge.night {
  background: rgba(83,165,189,0.1);
  color: var(--teal);
}

.shift-day-detail {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.shift-day-detail .sdd-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.shift-day-detail .sdd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--section-bg);
  font-size: 0.88rem;
}
.shift-day-detail .sdd-item:last-child { border-bottom: none; }
.shift-day-detail .sdd-time {
  font-weight: 600;
  color: var(--primary-green);
  min-width: 100px;
}

/* ===== Bulletin Board Page ===== */

/* Page header with title and new-post button */
.bulletin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bulletin-page-header .page-title {
  margin-bottom: 0;
}
.bulletin-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
}
.bulletin-new-btn:hover {
  background: var(--primary-green-hover);
  box-shadow: 0 2px 8px rgba(13,158,79,0.25);
}
.bulletin-new-btn:active {
  transform: scale(0.97);
}

/* Empty state */
.bulletin-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--medium-brown);
}
.bulletin-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.bulletin-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 6px;
}
.bulletin-empty-desc {
  font-size: 0.85rem;
  color: var(--medium-brown);
}

/* List item */
.bulletin-list-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.bulletin-list-item:active { transform: scale(0.98); }
.bulletin-list-item.urgent {
  border-left: 4px solid var(--status-hold);
}
.bulletin-list-item.unread {
  border-left: 4px solid var(--primary-green);
  background: var(--primary-green-light);
}

.bulletin-list-item .bli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bli-category {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--section-bg);
  color: var(--medium-brown);
}
.bli-category.urgent {
  background: rgba(212,61,61,0.1);
  color: var(--status-hold);
}
.bli-unread-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-green);
  color: var(--white);
}

.bulletin-list-item .bli-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 4px;
}
.bulletin-list-item .bli-body {
  font-size: 0.82rem;
  color: var(--medium-brown);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.bulletin-list-item .bli-meta {
  font-size: 0.72rem;
  color: var(--light-brown);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bli-read-count {
  color: var(--teal);
}

/* Detail overlay */
.bulletin-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  z-index: 1000;
  overflow-y: auto;
  display: none;
}
.bulletin-detail-overlay.open { display: block; }
.bulletin-detail-header {
  background: var(--white);
  color: var(--dark-brown);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
}
.bulletin-detail-header .back-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-color);
  color: var(--dark-brown);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; min-width: 48px;
  transition: var(--transition);
}
.bulletin-detail-header .back-btn:hover { background: var(--section-bg); }
.bulletin-detail-header .bd-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  color: var(--dark-brown);
}
.bulletin-detail-body {
  padding: 20px 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Detail: admin actions */
.bd-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.bd-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--medium-brown);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
  font-family: var(--font-sans);
}
.bd-action-btn:hover { background: var(--section-bg); }
.bd-action-btn.delete { color: var(--status-hold); border-color: rgba(212,61,61,0.3); }
.bd-action-btn.delete:hover { background: rgba(212,61,61,0.06); }

/* Detail: category row */
.bd-category-row {
  margin-bottom: 12px;
}

/* Detail: meta */
.bulletin-detail-body .bd-meta {
  font-size: 0.82rem;
  color: var(--medium-brown);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Detail: content */
.bulletin-detail-body .bd-content {
  font-size: 0.92rem;
  color: var(--dark-brown);
  line-height: 1.8;
  white-space: pre-wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
}

/* Detail: read info (admin) */
.bd-read-info {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.bd-read-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--medium-brown);
  margin-bottom: 8px;
}
.bd-read-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bd-reader {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: var(--section-bg);
  border-radius: 12px;
  color: var(--medium-brown);
}

/* Form styles for bulletin create/edit */
.bulletin-form {
  padding: 4px 0;
}
.bulletin-form .form-group {
  margin-bottom: 16px;
}
.bulletin-form .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--medium-brown);
  margin-bottom: 6px;
}
.required-mark {
  color: var(--status-hold);
}
.bulletin-form .form-group input,
.bulletin-form .form-group select,
.bulletin-form .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  color: var(--dark-brown);
  background: var(--white);
  transition: var(--transition);
}
.bulletin-form .form-group input:focus,
.bulletin-form .form-group select:focus,
.bulletin-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(13,158,79,0.1);
}
.bulletin-form .form-group textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.7;
}
.bulletin-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}
.bulletin-form-actions .btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  min-height: 44px;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.bulletin-form-actions .btn-secondary {
  background: var(--section-bg);
  color: var(--medium-brown);
}
.bulletin-form-actions .btn-secondary:hover {
  background: var(--border-color);
}
.bulletin-form-actions .btn-primary {
  background: var(--primary-green);
  color: var(--white);
}
.bulletin-form-actions .btn-primary:hover {
  background: var(--primary-green-hover);
  box-shadow: 0 2px 8px rgba(13,158,79,0.25);
}

/* ===== Report Detail Overlay ===== */
.report-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  z-index: 1000;
  overflow-y: auto;
  display: none;
}
.report-detail-overlay.open { display: block; }
.report-detail-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  color: var(--dark-brown);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}
.report-detail-header .back-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-color);
  color: var(--dark-brown);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; min-width: 48px;
  transition: var(--transition);
}
.report-detail-header .back-btn:hover { background: var(--section-bg); }
.report-detail-header .rd-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  color: var(--dark-brown);
}

/* ===== Admin Page ===== */
.admin-section {
  margin-bottom: 20px;
}
.admin-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Projects Page (Mobile) ===== */
.project-card-mobile {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  padding: 16px;
}
.pcm-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.pcm-status {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; color: var(--white); white-space: nowrap;
}
.pcm-status.status-in-progress { background: var(--status-in-progress); }
.pcm-status.status-review { background: var(--status-review); }
.pcm-status.status-done { background: var(--status-done); }
.pcm-status.status-hold { background: var(--status-hold); }
.pcm-status.status-not-started { background: var(--status-not-started); }
.pcm-name { font-weight: 700; font-size: 0.95rem; }
.pcm-meta { font-size: 0.8rem; color: var(--medium-brown); display: flex; gap: 12px; margin-bottom: 8px; }
.pcm-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pcm-progress-bar { flex: 1; height: 6px; background: #E8E5E0; border-radius: 3px; overflow: hidden; }
.pcm-progress-fill { height: 100%; background: var(--primary-green); border-radius: 3px; transition: width 0.3s; }
.pcm-progress-text { font-size: 0.75rem; color: var(--medium-brown); white-space: nowrap; }
.pcm-alert { font-size: 0.8rem; color: #D94040; font-weight: 600; margin-bottom: 8px; }
.pcm-tasks { border-top: 1px solid #F0EDE8; padding-top: 8px; }
.pcm-task-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid #F8F6F3;
}
.pcm-task-item.overdue { color: #D94040; }
.pcm-task-status { width: 20px; text-align: center; flex-shrink: 0; }
.pcm-task-name { flex: 1; }
.pcm-task-deadline { font-size: 0.75rem; color: var(--medium-brown); flex-shrink: 0; }
.pcm-changelog { border-top: 1px solid #F0EDE8; padding-top: 8px; margin-top: 8px; }
.pcm-changelog-title { font-size: 0.8rem; font-weight: 600; color: var(--medium-brown); margin-bottom: 4px; }
.pcm-log-item { font-size: 0.78rem; color: var(--medium-brown); padding: 2px 0; }
.pcm-log-date { color: var(--light-brown); margin-right: 4px; }

/* Admin: Summary Bar */
.admin-summary-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.admin-summary-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary-green);
  transition: var(--transition);
}
.admin-summary-card.in-progress { border-left-color: var(--status-in-progress); }
.admin-summary-card.needs-action { border-left-color: var(--amber-orange); }
.admin-summary-card.done { border-left-color: var(--status-done); }
.admin-summary-card.overdue { border-left-color: var(--status-hold); }
.admin-summary-card .summary-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.admin-summary-card.in-progress .summary-icon { background: rgba(83,165,189,0.12); color: var(--status-in-progress); }
.admin-summary-card.needs-action .summary-icon { background: rgba(235,153,55,0.12); color: var(--amber-orange); }
.admin-summary-card.done .summary-icon { background: rgba(0,153,51,0.12); color: var(--status-done); }
.admin-summary-card.overdue .summary-icon { background: rgba(217,64,64,0.12); color: var(--status-hold); }
.admin-summary-card .summary-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.admin-summary-card .summary-label { font-size: 0.72rem; color: var(--medium-brown); }

/* Admin: KPI Row */
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.admin-kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  position: relative;
  transition: var(--transition);
}
.admin-kpi-card .kpi-icon { font-size: 1rem; margin-bottom: 2px; }
.admin-kpi-card .kpi-value {
  font-size: 1.4rem; font-weight: 700;
  color: var(--primary-green); line-height: 1.2;
}
.admin-kpi-card .kpi-label {
  font-size: 0.72rem; color: var(--medium-brown);
  font-weight: 500; margin-top: 2px;
}
.admin-kpi-card .help-icon {
  position: absolute; top: 6px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--section-bg); color: var(--medium-brown);
  font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
  cursor: help; font-weight: 700;
}
.admin-kpi-card .help-icon .tooltip {
  display: none; position: absolute; top: 24px; right: 0;
  background: var(--dark-brown); color: var(--white);
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.72rem; font-weight: 400; width: 200px;
  text-align: left; z-index: 200; box-shadow: var(--shadow-md); line-height: 1.5;
}
.admin-kpi-card .help-icon:hover .tooltip { display: block; }

/* Admin: Alert Banner */
.admin-alert-banner {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: alertSlideIn 0.4s ease;
}
@keyframes alertSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
.alert-item.high {
  background: #FEF0F0; border-left: 4px solid var(--status-hold); color: #8B1A1A;
}
.alert-item.medium {
  background: #FFF8EE; border-left: 4px solid var(--amber-orange); color: #8B5A00;
}
.alert-item.low {
  background: #EDF7FC; border-left: 4px solid var(--teal); color: #1A5A6E;
}
.alert-item .alert-icon { font-size: 1rem; flex-shrink: 0; }
.alert-item .alert-text { flex: 1; font-size: 0.8rem; }
.alert-item .alert-dismiss {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; opacity: 0.5; transition: var(--transition); color: inherit;
  min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center;
}
.alert-item .alert-dismiss:hover { opacity: 1; }

/* Admin: Project Cards */
.admin-project-list { display: flex; flex-direction: column; gap: 10px; }
.project-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-card); border: 1px solid var(--border-light);
  overflow: hidden; transition: var(--transition);
}
.project-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; user-select: none;
  transition: background var(--transition);
  flex-wrap: wrap;
}
.project-card-header:active { background: var(--section-bg); }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; position: relative;
}
.status-dot.overdue { animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,64,64,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(217,64,64,0); }
}
.status-dot[data-status="\u672A\u7740\u624B"] { background: var(--status-not-started); }
.status-dot[data-status="\u9032\u884C\u4E2D"] { background: var(--status-in-progress); }
.status-dot[data-status="\u30EC\u30D3\u30E5\u30FC\u5F85\u3061"] { background: var(--status-review); }
.status-dot[data-status="\u5B8C\u4E86"] { background: var(--status-done); }
.status-dot[data-status="\u4FDD\u7559"] { background: var(--status-hold); }
.project-name {
  font-weight: 600; font-size: 0.88rem; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-meta {
  font-size: 0.75rem; color: var(--medium-brown);
  display: flex; align-items: center; gap: 8px;
}
.progress-bar-wrap {
  width: 80px; height: 6px; background: var(--section-bg);
  border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.progress-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--primary-green); transition: width 0.6s ease;
}
.progress-text {
  font-size: 0.72rem; font-weight: 600;
  color: var(--primary-green); min-width: 32px; text-align: right;
}
.expand-icon {
  font-size: 0.8rem; color: var(--medium-brown);
  transition: transform var(--transition); flex-shrink: 0;
}
.project-card.expanded .expand-icon { transform: rotate(180deg); }

/* Card Body (Expandable) */
.project-card-body {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}
.project-card.expanded .project-card-body { max-height: 4000px; }
.project-card-body-inner {
  padding: 0 16px 16px; border-top: 1px solid var(--section-bg);
}

/* Task Table */
.task-table-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.task-table-wrap .staff-table { min-width: 640px; }
.task-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.task-table th {
  background: var(--section-bg); padding: 8px; text-align: left;
  font-weight: 600; color: var(--medium-brown); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.task-table th:hover { background: #E5E7D9; }
.task-table th .sort-arrow { margin-left: 2px; opacity: 0.4; font-size: 0.6rem; }
.task-table th.sorted-asc .sort-arrow,
.task-table th.sorted-desc .sort-arrow { opacity: 1; color: var(--primary-green); }
.task-table td {
  padding: 8px; border-bottom: 1px solid #F0EDEA; vertical-align: middle;
}
.task-table tr:last-child td { border-bottom: none; }
.task-table tr:hover td { background: #FAFBF7; }
.task-table tr.overdue-row td { background: #FEF8F6; }

.task-status-select {
  padding: 4px 6px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 0.75rem;
  background: var(--white); color: var(--dark-brown);
  cursor: pointer; outline: none;
}
.task-action-btn {
  padding: 4px 8px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--white);
  color: var(--medium-brown); font-size: 0.72rem;
  cursor: pointer; transition: var(--transition);
  min-width: 32px; min-height: 32px;
}
.task-action-btn:active {
  background: var(--section-bg); border-color: var(--primary-green);
  color: var(--primary-green);
}
.task-action-btn.delete-btn:active {
  background: #FEF0F0; border-color: var(--status-hold);
  color: var(--status-hold);
}
.task-actions { display: flex; gap: 4px; }

/* Change Log */
.change-log {
  margin-top: 12px; background: var(--section-bg);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.change-log-title {
  font-size: 0.78rem; font-weight: 600; color: var(--medium-brown);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.change-log-list {
  list-style: none; font-size: 0.72rem; color: var(--medium-brown);
  max-height: 120px; overflow-y: auto;
}
.change-log-list li {
  padding: 3px 0; border-bottom: 1px solid rgba(186,155,137,0.2);
  display: flex; gap: 6px;
}
.change-log-list li:last-child { border-bottom: none; }
.change-log-list .log-date {
  color: var(--light-brown); white-space: nowrap; font-size: 0.68rem;
}

/* Add Task Button */
.add-task-row { padding: 8px 0; text-align: center; }
.add-task-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; background: var(--primary-green);
  color: var(--white); border: none; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  min-height: 48px;
}
.add-task-btn:active { background: var(--light-green); }

/* Admin: Chat FAB */
.admin-chat-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #3D8FA5);
  color: var(--white);
  border: none;
  font-size: 28px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.admin-chat-fab:active { transform: scale(0.9); }
.admin-chat-fab.hidden { display: none; }

/* Admin: Chat Panel */
.admin-chat-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 16px;
}
.admin-chat-header {
  background: linear-gradient(135deg, var(--teal), #3D8FA5);
  color: var(--white); padding: 12px 16px;
  font-weight: 600; font-size: 0.88rem;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-chat-header .toggle-chat-btn {
  background: none; border: none; color: var(--white);
  font-size: 1.1rem; cursor: pointer; opacity: 0.8;
  min-width: 32px; min-height: 32px;
}
.admin-chat-body {
  padding: 12px; max-height: 300px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  max-width: 85%; padding: 10px 12px; border-radius: 12px;
  font-size: 0.82rem; line-height: 1.5;
}
.chat-msg.bot {
  align-self: flex-start; background: var(--section-bg);
  color: var(--dark-brown); border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end; background: var(--teal);
  color: var(--white); border-bottom-right-radius: 4px;
}
.chat-msg.loading {
  align-self: flex-start; background: var(--section-bg);
  color: var(--medium-brown); border-bottom-left-radius: 4px;
  font-style: italic;
}
.admin-chat-input-wrap {
  padding: 10px 12px; border-top: 1px solid var(--section-bg);
  display: flex; gap: 8px;
}
.admin-chat-input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border-color);
  border-radius: 20px; font-size: 0.84rem; outline: none;
}
.admin-chat-input:focus { border-color: var(--teal); }
.admin-chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--teal); color: var(--white); cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px;
  transition: var(--transition);
}
.admin-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 900; display: none; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--section-bg);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-size: 1.05rem; color: var(--dark-brown); }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--medium-brown); transition: var(--transition);
  min-width: 40px; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 16px 20px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--medium-brown); margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 1rem;
  color: var(--dark-brown); background: var(--white);
  outline: none; transition: var(--transition);
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.12);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--section-bg);
  display: flex; justify-content: flex-end; gap: 10px;
  padding-bottom: calc(14px + var(--safe-bottom));
}
.btn {
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); border: 1px solid transparent;
  min-height: 48px;
}
.btn-primary { background: var(--primary-green); color: var(--white); }
.btn-primary:hover { background: var(--primary-green-hover); box-shadow: 0 2px 8px rgba(13,158,79,0.25); }
.btn-secondary { background: var(--white); color: var(--medium-brown); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--bg); border-color: var(--medium-brown); color: var(--dark-brown); }
.btn-danger { background: var(--status-hold); color: var(--white); }
.btn-danger:hover { background: #C03030; box-shadow: 0 2px 8px rgba(212,61,61,0.25); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Admin filter bar */
.admin-filter-bar {
  background: var(--section-bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-filter-bar .filter-row {
  display: flex;
  gap: 8px;
}
.admin-filter-bar select,
.admin-filter-bar input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--dark-brown);
  font-size: 0.85rem;
  outline: none;
}
.admin-filter-bar select:focus,
.admin-filter-bar input[type="text"]:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.12);
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10000;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease; transition: opacity 0.3s ease;
  max-width: 440px; width: 90%;
  text-align: center;
}
.toast.success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #2E7D32; }
.toast.error { background: #FEF0F0; color: #C62828; border-left: 4px solid #C62828; }
.toast.info { background: #E3F2FD; color: #1565C0; border-left: 4px solid #1565C0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Utility ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===== PC Admin Wide Layout ===== */
/* Sidebar (hidden by default, shown only in admin-wide mode on PC) */
.admin-sidebar {
  display: none;
}

@media (min-width: 768px) {
  /* When body has admin-wide / member-wide class, switch to wide layout.
     構造（ヘッダー固定・サイドバー・コンテンツ配置）は管理者とメンバーで共通。
     一般メンバーは body.member-wide（管理導線はサイドバー JS 側で非描画）。 */
  body.admin-wide,
  body.member-wide {
    max-width: none;
    box-shadow: none;
    margin: 0;
    background: var(--bg);
  }

  /* Header spans full width */
  body.admin-wide .app-header,
  body.member-wide .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--header-height);
    padding: 0 28px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
  }

  body.admin-wide .app-header .logo-icon,
  body.member-wide .app-header .logo-icon {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
    border-radius: 10px;
  }

  body.admin-wide .app-header-title,
  body.member-wide .app-header-title {
    font-size: 1.2rem;
    font-weight: 700;
  }

  /* ===== Sidebar - Refined Desktop Design ===== */
  body.admin-wide .admin-sidebar,
  body.member-wide .admin-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border-color);
    z-index: 500;
    overflow-y: auto;
    padding: 16px 0 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
  }

  body.admin-wide .admin-sidebar::-webkit-scrollbar,
  body.member-wide .admin-sidebar::-webkit-scrollbar {
    width: 4px;
  }
  body.admin-wide .admin-sidebar::-webkit-scrollbar-thumb,
  body.member-wide .admin-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
  }

  body.admin-wide .admin-sidebar .sidebar-nav,
  body.member-wide .admin-sidebar .sidebar-nav {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  body.admin-wide .admin-sidebar .sidebar-nav-item,
  body.member-wide .admin-sidebar .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--medium-brown);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
    position: relative;
  }

  body.admin-wide .admin-sidebar .sidebar-nav-item:hover,
  body.member-wide .admin-sidebar .sidebar-nav-item:hover {
    background: var(--bg);
    color: var(--dark-brown);
  }

  body.admin-wide .admin-sidebar .sidebar-nav-item.active,
  body.member-wide .admin-sidebar .sidebar-nav-item.active {
    color: var(--primary-green);
    font-weight: 600;
    background: var(--primary-green-light);
  }

  body.admin-wide .admin-sidebar .sidebar-nav-item.active::before,
  body.member-wide .admin-sidebar .sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary-green);
    border-radius: 0 3px 3px 0;
  }

  body.admin-wide .admin-sidebar .sidebar-nav-item .sidebar-icon,
  body.member-wide .admin-sidebar .sidebar-nav-item .sidebar-icon {
    font-size: 1.15rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
  }

  body.admin-wide .admin-sidebar .sidebar-divider,
  body.member-wide .admin-sidebar .sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 24px;
  }

  body.admin-wide .admin-sidebar .sidebar-section-label,
  body.member-wide .admin-sidebar .sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--light-brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 28px 6px;
  }

  /* バージョン表示（サイドバー最下部・控えめに） */
  body.admin-wide .admin-sidebar .sidebar-version,
  body.member-wide .admin-sidebar .sidebar-version {
    margin-top: auto;
    padding: 14px 28px 18px;
    font-size: 0.7rem;
    color: var(--light-brown);
    letter-spacing: 0.02em;
  }

  /* Hide bottom nav for PC wide layout (admin / member) */
  body.admin-wide .bottom-nav,
  body.member-wide .bottom-nav {
    display: none !important;
  }

  /* Hide the admin gear button in header (sidebar replaces it).
     member-wide では #adminBtn は元々非表示だが、念のため明示。 */
  body.admin-wide #adminBtn,
  body.member-wide #adminBtn {
    display: none !important;
  }

  /* ===== Main content area - Refined Desktop Layout ===== */
  body.admin-wide .page-container,
  body.member-wide .page-container {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    max-width: none;
    padding: 32px 40px 48px;
    min-height: calc(100vh - var(--header-height));
  }

  /* Constrain content width for readability on ultra-wide screens */
  body.admin-wide .page-container > *,
  body.member-wide .page-container > * {
    max-width: 1200px;
  }

  /* Page title (admin / member wide) */
  body.admin-wide .page-title,
  body.member-wide .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
    color: var(--dark-brown);
  }

  /* Section titles in admin */
  body.admin-wide .admin-section {
    margin-bottom: 28px;
  }

  body.admin-wide .admin-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-green);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  /* ===== Admin Summary Bar - 4 columns with refined cards ===== */
  body.admin-wide .admin-summary-bar {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  body.admin-wide .admin-summary-card {
    padding: 20px;
    border-radius: var(--radius);
    border-left-width: 4px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-green);
    transition: var(--transition);
  }

  body.admin-wide .admin-summary-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
  }

  body.admin-wide .admin-summary-card .summary-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  body.admin-wide .admin-summary-card .summary-label {
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 2px;
  }

  /* ===== Admin KPI Row - 4 columns refined ===== */
  body.admin-wide .admin-kpi-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  body.admin-wide .admin-kpi-card {
    padding: 22px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
  }

  body.admin-wide .admin-kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
  }

  body.admin-wide .admin-kpi-card .kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  body.admin-wide .admin-kpi-card .kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
  }

  /* ===== Project Cards - 2 column grid ===== */
  body.admin-wide .admin-project-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  body.admin-wide .project-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
  }

  body.admin-wide .project-card:hover {
    box-shadow: var(--shadow-card-hover);
  }

  body.admin-wide .project-card-header {
    padding: 18px 20px;
  }

  body.admin-wide .project-card-header:hover {
    background: var(--bg);
  }

  body.admin-wide .project-name {
    font-size: 0.95rem;
    font-weight: 600;
  }

  /* ===== Task Table - wider refined display ===== */
  body.admin-wide .task-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
  }

  body.admin-wide .task-table {
    font-size: 0.85rem;
  }

  body.admin-wide .task-table th {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg);
    color: var(--medium-brown);
    border-bottom: 1px solid var(--border-color);
  }

  body.admin-wide .task-table th:hover {
    background: #E8E9ED;
    color: var(--dark-brown);
  }

  body.admin-wide .task-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
  }

  body.admin-wide .task-table tr:hover td {
    background: rgba(13,158,79,0.02);
  }

  body.admin-wide .task-status-select {
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
  }

  body.admin-wide .task-status-select:hover {
    border-color: var(--primary-green);
  }

  body.admin-wide .task-action-btn {
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    min-width: 34px;
    min-height: 34px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
  }

  body.admin-wide .task-action-btn:hover {
    background: var(--bg);
    border-color: var(--primary-green);
    color: var(--primary-green);
  }

  body.admin-wide .task-action-btn.delete-btn:hover {
    background: #FEF0F0;
    border-color: var(--status-hold);
    color: var(--status-hold);
  }

  /* ===== Filter Bar - horizontal refined ===== */
  body.admin-wide .admin-filter-bar {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
  }

  body.admin-wide .admin-filter-bar .filter-row {
    flex: 0 0 auto;
    gap: 10px;
  }

  body.admin-wide .admin-filter-bar select {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
  }

  body.admin-wide .admin-filter-bar select:hover {
    border-color: var(--primary-green);
  }

  body.admin-wide .admin-filter-bar input[type="text"] {
    flex: 1;
    min-width: 280px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
  }

  body.admin-wide .admin-filter-bar input[type="text"]:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(13,158,79,0.1);
  }

  /* ===== Chat FAB: fixed bottom-right on PC ===== */
  body.admin-wide .admin-chat-fab {
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(59,153,177,0.3);
    transition: all var(--transition);
  }

  body.admin-wide .admin-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59,153,177,0.4);
  }

  /* ===== Chat Panel - refined ===== */
  body.admin-wide .admin-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 28px;
    width: 400px;
    z-index: 80;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
  }

  body.admin-wide .admin-chat-header {
    padding: 16px 20px;
    font-size: 0.92rem;
  }

  body.admin-wide .admin-chat-body {
    max-height: 360px;
    padding: 16px;
  }

  body.admin-wide .chat-msg {
    font-size: 0.85rem;
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.6;
  }

  /* ===== Modal: centered on PC ===== */
  body.admin-wide .modal-overlay {
    align-items: center;
  }

  body.admin-wide .modal {
    border-radius: var(--radius-lg);
    max-width: 580px;
    box-shadow: var(--shadow-lg);
  }

  body.admin-wide .modal-header {
    padding: 20px 24px;
  }

  body.admin-wide .modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
  }

  body.admin-wide .modal-body {
    padding: 20px 24px;
  }

  body.admin-wide .modal-footer {
    padding: 18px 24px;
  }

  /* ===== Overlays shift for sidebar (admin / member) ===== */
  body.admin-wide .report-detail-overlay,
  body.admin-wide .bulletin-detail-overlay,
  body.admin-wide .meeting-detail-overlay,
  body.member-wide .report-detail-overlay,
  body.member-wide .bulletin-detail-overlay,
  body.member-wide .meeting-detail-overlay {
    left: var(--sidebar-width);
    bottom: 0;
  }

  body.admin-wide .bulletin-detail-body,
  body.admin-wide .report-detail-body,
  body.member-wide .bulletin-detail-body,
  body.member-wide .report-detail-body {
    max-width: 760px;
    padding: 32px 40px;
  }

  /* ===== Home page desktop enhancements ===== */
  body.admin-wide .home-greeting,
  body.member-wide .home-greeting {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  body.admin-wide .home-date,
  body.member-wide .home-date {
    font-size: 0.88rem;
    margin-bottom: 24px;
  }

  body.admin-wide .home-cta,
  body.member-wide .home-cta {
    padding: 24px;
    border-radius: var(--radius);
    max-width: 600px;
    margin-bottom: 28px;
  }

  body.admin-wide .home-section-title,
  body.member-wide .home-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    margin-top: 24px !important;
  }

  /* ===== Desktop card grid for home sections ===== */
  body.admin-wide #homeProjectsPreview,
  body.member-wide #homeProjectsPreview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
  }

  body.admin-wide .home-project-card,
  body.member-wide .home-project-card {
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    margin-bottom: 0;
  }

  body.admin-wide .home-project-card:hover,
  body.member-wide .home-project-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
  }

  /* ===== Shift calendar desktop ===== */
  body.admin-wide .shift-calendar .cal-cell,
  body.member-wide .shift-calendar .cal-cell {
    min-height: 80px;
    padding: 8px;
  }

  /* ===== Report calendar desktop ===== */
  body.admin-wide .report-calendar,
  body.member-wide .report-calendar {
    border-radius: var(--radius-lg);
  }
  body.admin-wide .rcal-cell,
  body.member-wide .rcal-cell {
    min-height: 72px;
    padding: 10px 6px 8px;
  }
  body.admin-wide .rcal-cell:hover,
  body.member-wide .rcal-cell:hover {
    background: var(--section-bg);
  }
  body.admin-wide .rcal-day,
  body.member-wide .rcal-day {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }
  body.admin-wide .rcal-dot,
  body.member-wide .rcal-dot {
    width: 10px;
    height: 10px;
  }

  body.admin-wide .report-list-item,
  body.member-wide .report-list-item {
    padding: 18px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
  }

  body.admin-wide .report-list-item:hover,
  body.member-wide .report-list-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
  }

  /* ===== Bulletin list desktop ===== */
  body.admin-wide .bulletin-list-item,
  body.member-wide .bulletin-list-item {
    padding: 18px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
  }

  body.admin-wide .bulletin-list-item:hover,
  body.member-wide .bulletin-list-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
  }

  /* ===== Meeting list desktop ===== */
  body.admin-wide .meeting-list-item,
  body.member-wide .meeting-list-item {
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    margin-bottom: 8px;
  }
  body.admin-wide .meeting-list-item .mli-clickable,
  body.member-wide .meeting-list-item .mli-clickable {
    padding: 18px 22px;
  }
  body.admin-wide .meeting-list-item:hover,
  body.member-wide .meeting-list-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    border-color: rgba(0,153,51,0.2);
  }
  body.admin-wide .mli-delete-btn,
  body.member-wide .mli-delete-btn {
    width: 52px;
    min-width: 52px;
    opacity: 0;
  }
  body.admin-wide .meeting-list-item:hover .mli-delete-btn,
  body.member-wide .meeting-list-item:hover .mli-delete-btn {
    opacity: 0.6;
  }
  body.admin-wide .meeting-list-item:hover .mli-delete-btn:hover,
  body.member-wide .meeting-list-item:hover .mli-delete-btn:hover {
    opacity: 1;
  }
  /* PC: FAB非表示（ページ内ボタンで代替・管理者/メンバー共通） */
  body.admin-wide .report-fab,
  body.admin-wide .meeting-page-fab,
  body.member-wide .report-fab,
  body.member-wide .meeting-page-fab {
    display: none !important;
  }

  /* ===== Attendance desktop ===== */
  body.admin-wide .att-clock-section {
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    max-width: 600px;
    margin-bottom: 24px;
  }

  body.admin-wide .att-summary {
    max-width: 600px;
    gap: 14px;
  }

  body.admin-wide .att-summary-item {
    padding: 18px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
  }

  body.admin-wide .att-summary-item:hover {
    box-shadow: var(--shadow-card-hover);
  }

  body.admin-wide .att-summary-value {
    font-size: 1.6rem;
  }

  body.admin-wide .att-table {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
  }

  body.admin-wide .att-table th {
    padding: 12px 14px;
    font-weight: 600;
  }

  body.admin-wide .att-table td {
    padding: 10px 14px;
  }

  /* ===== Files desktop ===== */
  body.admin-wide .files-upload-area {
    max-width: 500px;
    padding: 36px 24px;
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
    transition: var(--transition);
  }

  body.admin-wide .files-upload-area:hover {
    border-color: var(--primary-green);
    background: var(--primary-green-light);
  }

  body.admin-wide .file-item {
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
  }

  body.admin-wide .file-item:hover {
    box-shadow: var(--shadow-card-hover);
  }

  /* ===== Buttons desktop refinement ===== */
  body.admin-wide .btn,
  body.member-wide .btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
  }

  body.admin-wide .btn-primary:hover,
  body.member-wide .btn-primary:hover {
    background: var(--primary-green-hover);
    box-shadow: 0 2px 8px rgba(13,158,79,0.3);
    transform: translateY(-1px);
  }

  body.admin-wide .btn-secondary:hover,
  body.member-wide .btn-secondary:hover {
    background: var(--bg);
    border-color: var(--medium-brown);
  }

  body.admin-wide .add-task-btn {
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-size: 0.85rem;
    transition: all var(--transition);
  }

  body.admin-wide .add-task-btn:hover {
    background: var(--primary-green-hover);
    box-shadow: 0 2px 8px rgba(13,158,79,0.3);
    transform: translateY(-1px);
  }

  /* ===== Change Log refined ===== */
  body.admin-wide .change-log {
    border-radius: var(--radius-sm);
    padding: 16px 18px;
  }

  /* ===== Alert items desktop ===== */
  body.admin-wide .alert-item {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
  }

  /* ===== Footer area ===== */
  body.admin-wide .admin-footer {
    margin-left: var(--sidebar-width);
    text-align: center;
    padding: 20px;
    font-size: 0.78rem;
    color: var(--light-brown);
    border-top: 1px solid var(--border-color);
  }

  /* ===== Form elements desktop refinement ===== */
  body.admin-wide .form-group input,
  body.admin-wide .form-group select,
  body.admin-wide .form-group textarea,
  body.member-wide .form-group input,
  body.member-wide .form-group select,
  body.member-wide .form-group textarea {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
  }

  body.admin-wide .form-group input:hover,
  body.admin-wide .form-group select:hover,
  body.admin-wide .form-group textarea:hover,
  body.member-wide .form-group input:hover,
  body.member-wide .form-group select:hover,
  body.member-wide .form-group textarea:hover {
    border-color: var(--medium-brown);
  }

  body.admin-wide .form-group input:focus,
  body.admin-wide .form-group select:focus,
  body.admin-wide .form-group textarea:focus,
  body.member-wide .form-group input:focus,
  body.member-wide .form-group select:focus,
  body.member-wide .form-group textarea:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(13,158,79,0.1);
  }

  body.admin-wide .form-group label,
  body.member-wide .form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-brown);
  }
}

/* ===================================================================
   案C: メンバー PC サイドバー表示
   -------------------------------------------------------------------
   旧「案B（メンバー画面 880px 中央寄せ）」のブロックはここにあったが、
   代表のご決定（案C: メンバーも PC では左サイドバー表示）により
   本ブロックは撤去した。メンバーの PC ワイド表示は上部の
   body.member-wide ルール群（admin-wide と構造共有）に一本化されている。
   スマホ（768px 未満）では member-wide は付与されず、従来どおり
   ボトムナビ表示。案B 撤去によりスマホは案B 導入前の素の表示に戻る。
   =================================================================== */

/* ===== Meeting Page ===== */

/* Page header with inline create button */
.meetings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.meetings-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.meetings-create-btn:hover {
  background: var(--primary-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,153,51,0.25);
}
.meetings-create-btn span {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Filter */
/* ===== Meeting View Toggle ===== */
.meeting-view-toggle {
  display: flex;
  background: var(--section-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 12px;
  gap: 2px;
}
.mvt-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--medium-brown);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.mvt-btn.active {
  background: var(--white);
  color: var(--dark-brown);
  box-shadow: var(--shadow-sm);
}
.mvt-btn:not(.active):active {
  background: rgba(255,255,255,0.4);
}

/* Calendar dots row (multiple meetings per day) */
.rcal-dots-row {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
}

/* Meeting day list item (calendar day click with multiple meetings) */
.meeting-day-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.meeting-day-item:last-child {
  border-bottom: none;
}
.meeting-day-item:active {
  background: var(--section-bg);
}

.meeting-filter {
  margin-bottom: 16px;
}
.meeting-filter select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--dark-brown);
  background: var(--white);
  outline: none;
  -webkit-appearance: none;
  min-height: 48px;
  transition: var(--transition);
}
.meeting-filter select:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.12);
}

/* Empty state */
.meeting-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--medium-brown);
}
.meeting-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}
.meeting-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin-bottom: 6px;
}
.meeting-empty-desc {
  font-size: 0.85rem;
  color: var(--medium-brown);
}

/* Meeting card */
.meeting-list-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid var(--primary-green);
  position: relative;
  display: flex;
  align-items: stretch;
}
.meeting-list-item .mli-clickable {
  flex: 1;
  padding: 14px 16px;
  min-width: 0;
}
.meeting-list-item.status-draft {
  border-left-color: var(--amber-orange);
}
.meeting-list-item.status-recording {
  border-left-color: var(--status-hold);
}
.meeting-list-item.status-transcribing {
  border-left-color: var(--teal);
}
.meeting-list-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.meeting-list-item:active { transform: scale(0.98); }
.meeting-list-item .mli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.meeting-list-item .mli-date {
  font-size: 0.82rem;
  color: var(--medium-brown);
}
.meeting-list-item .mli-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 6px;
  line-height: 1.4;
}
.meeting-list-item .mli-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--medium-brown);
  flex-wrap: wrap;
}
.meeting-list-item .mli-author {
  opacity: 0.8;
}

/* Delete button */
.mli-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  background: none;
  border: none;
  border-left: 1px solid var(--border-light);
  color: var(--medium-brown);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.4;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.mli-delete-btn:hover {
  opacity: 1;
  background: rgba(229,62,62,0.06);
  color: #E53E3E;
}

/* Status badge */
.mli-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.mli-status.status-confirmed {
  background: rgba(0,153,51,0.1);
  color: var(--status-done);
}
.mli-status.status-draft {
  background: rgba(235,153,55,0.1);
  color: var(--amber-orange);
}
.mli-status.status-recording {
  background: rgba(217,64,64,0.1);
  color: var(--status-hold);
}
.mli-status.status-transcribing {
  background: rgba(83,165,189,0.1);
  color: var(--teal);
}

/* ===== Meeting Trash (ゴミ箱) ===== */
.meeting-trash-item {
  border-left-color: #CBD5E0 !important;
  opacity: 0.85;
}
.meeting-trash-item .mli-title {
  text-decoration: line-through;
  text-decoration-color: rgba(0,0,0,0.2);
}
.trash-days-label {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.trash-days-normal {
  background: rgba(160,174,192,0.15);
  color: #718096;
}
.trash-days-urgent {
  background: rgba(229,62,62,0.1);
  color: #E53E3E;
}
.trash-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-left: 1px solid var(--border-light);
  justify-content: center;
  min-width: 100px;
}
.trash-restore-btn,
.trash-permanent-btn {
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
}
.trash-restore-btn {
  background: rgba(0,153,51,0.1);
  color: var(--status-done);
}
.trash-restore-btn:hover {
  background: rgba(0,153,51,0.2);
}
.trash-permanent-btn {
  background: rgba(229,62,62,0.08);
  color: #E53E3E;
}
.trash-permanent-btn:hover {
  background: rgba(229,62,62,0.18);
}

/* Meeting Recorder */
.meeting-recorder-area {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 16px;
  text-align: center;
  margin-bottom: 16px;
}
.meeting-recorder-status {
  font-size: 0.92rem;
  color: var(--medium-brown);
  margin-bottom: 12px;
  min-height: 24px;
  font-weight: 500;
}
.meeting-recorder-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.meeting-recorder-controls {
  margin-bottom: 16px;
}
.meeting-record-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid var(--status-hold);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: var(--transition);
  min-height: 88px;
}
.meeting-record-btn .meeting-record-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--status-hold);
  transition: var(--transition);
}
.meeting-record-btn.recording .meeting-record-inner {
  border-radius: 6px;
  width: 30px;
  height: 30px;
}
.meeting-record-btn.recording {
  animation: recordingPulse 1.5s infinite;
}
@keyframes recordingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,64,64,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(217,64,64,0); }
}
.meeting-record-btn:active { transform: scale(0.95); }

.meeting-recorder-secondary {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.meeting-pause-btn,
.meeting-stop-btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.meeting-pause-btn {
  background: var(--white);
  color: var(--amber-orange);
  border: 2px solid var(--amber-orange);
}
.meeting-pause-btn:active {
  background: rgba(235,153,55,0.1);
}
.meeting-stop-btn {
  background: var(--status-hold);
  color: var(--white);
  border: 2px solid var(--status-hold);
}
.meeting-stop-btn:active {
  background: #C03030;
}

.meeting-post-record {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* Meeting Progress */
.meeting-progress {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.meeting-progress-bar {
  height: 6px;
  background: var(--primary-green);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
  margin-bottom: 8px;
}
.meeting-progress-text {
  font-size: 0.85rem;
  color: var(--medium-brown);
  text-align: center;
  font-weight: 500;
}

/* Meeting Detail Overlay */
.meeting-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  z-index: 1000;
  overflow-y: auto;
  display: none;
}
.meeting-detail-overlay.open { display: block; }
.meeting-detail-overlay textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  background: #fff;
}
.meeting-detail-overlay textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0,153,51,0.15);
}
.meeting-detail-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  color: var(--dark-brown);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}
.meeting-detail-header .back-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-color);
  color: var(--dark-brown);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; min-width: 48px;
  transition: var(--transition);
}
.meeting-detail-header .back-btn:hover { background: var(--section-bg); }
.meeting-detail-header .md-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  color: var(--dark-brown);
}

/* Meeting Action Items */
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-item {
  background: var(--section-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.action-item-who {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-green);
  margin-bottom: 2px;
}
.action-item-what {
  font-size: 0.88rem;
  color: var(--dark-brown);
  margin-bottom: 2px;
}
.action-item-deadline {
  font-size: 0.78rem;
  color: var(--medium-brown);
}

/* Meeting preview on home */
.meeting-preview-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--section-bg);
  cursor: pointer;
  transition: var(--transition);
}
.meeting-preview-item:last-child { border-bottom: none; }
.meeting-preview-item:active { background: var(--section-bg); }

/* ===== Attendance Page ===== */
.att-clock-section {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--white);
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(13,158,79,0.2);
}
.att-date {
  font-size: 0.88rem;
  opacity: 0.9;
  margin-bottom: 4px;
}
.att-time {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.att-clock-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.att-clock-btn {
  padding: 14px 40px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
}
.att-clock-btn:active { transform: scale(0.95); }
.att-clock-btn.clock-in {
  background: var(--white);
  color: var(--primary-green);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.att-clock-btn.clock-out {
  background: var(--amber-orange);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.att-done-label {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.9;
  padding: 14px 0;
}
.att-status {
  font-size: 0.82rem;
  opacity: 0.85;
  margin-top: 4px;
}

.att-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: var(--section-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.att-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--medium-brown);
  cursor: pointer;
  transition: var(--transition);
}
.att-tab.active {
  background: var(--primary-green);
  color: var(--white);
}

.att-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.att-summary-item {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 8px;
  text-align: center;
}
.att-summary-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-green);
}
.att-summary-label {
  font-size: 0.72rem;
  color: var(--medium-brown);
  margin-top: 2px;
}

.att-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.att-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
  font-size: 0.82rem;
}
.att-table th {
  background: var(--section-bg);
  padding: 8px 6px;
  font-weight: 600;
  color: var(--dark-brown);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.att-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--section-bg);
  white-space: nowrap;
}
.att-table tr.weekend td {
  background: rgba(235, 153, 55, 0.05);
}
.att-table .overtime {
  color: var(--status-hold);
  font-weight: 600;
}

.att-csv-btn {
  padding: 8px 16px;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.att-csv-btn:active { transform: scale(0.95); }

.att-staff-summary, .att-all-records {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.att-staff-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 10px;
}

/* ===== Files Page ===== */
.files-project-select {
  margin-bottom: 12px;
}
.files-project-select label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--medium-brown);
  margin-bottom: 4px;
}
.files-project-select select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--section-bg);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.88rem;
  color: var(--dark-brown);
}

.files-upload-area {
  background: var(--white);
  border: 2px dashed var(--light-brown);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}
.files-upload-area:active {
  border-color: var(--primary-green);
  background: rgba(0,153,51,0.03);
}
.files-upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.files-upload-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin-bottom: 4px;
}
.files-upload-hint {
  font-size: 0.75rem;
  color: var(--medium-brown);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 8px;
  transition: var(--transition);
}
.file-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.file-info {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--medium-brown);
  margin-top: 2px;
}
.file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.file-dl-btn, .file-del-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}
.file-dl-btn {
  background: rgba(0,153,51,0.1);
  color: var(--primary-green);
}
.file-dl-btn:active { background: rgba(0,153,51,0.2); }
.file-del-btn {
  background: rgba(217,64,64,0.1);
  color: var(--status-hold);
}
.file-del-btn:active { background: rgba(217,64,64,0.2); }

/* ===== Project Files Section ===== */
.pcm-files-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light, #eee);
}
.pcm-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pcm-files-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-brown);
}
.pcm-file-add-btn {
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.pcm-file-add-btn:active {
  opacity: 0.8;
}
.pcm-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--section-bg, #f5f5f5);
}
.pcm-file-item:last-child {
  border-bottom: none;
}
.pcm-file-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.pcm-file-info {
  flex: 1;
  min-width: 0;
}
.pcm-file-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary-green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcm-file-meta {
  display: flex;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--medium-brown);
  margin-top: 1px;
}
.pcm-file-delete-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(217,64,64,0.1);
  color: var(--status-hold, #D94040);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.pcm-file-delete-btn:active {
  background: rgba(217,64,64,0.2);
}

/* ===== Bottom Nav 5-tab adjustment ===== */
.bottom-nav .nav-tab {
  font-size: 0.68rem;
}
.bottom-nav .nav-tab .nav-icon {
  font-size: 1.2rem;
}

/* ===== Communication Sub-tabs ===== */
.comm-sub-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  z-index: 50;
}
.comm-sub-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--medium-brown);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.comm-sub-tab.active {
  color: var(--primary-green);
}
.comm-sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary-green);
  border-radius: 3px 3px 0 0;
}

/* ===== Global AI Chat FAB & Panel ===== */
.global-chat-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 84px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #3D8FA5);
  color: var(--white);
  border: none;
  font-size: 28px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.global-chat-fab:active { transform: scale(0.9); }
.global-chat-fab.hidden { display: none; }

.global-chat-panel {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  right: 12px;
  left: 12px;
  z-index: 950;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: calc(100vh - var(--bottom-nav-height) - var(--safe-bottom) - 80px);
  display: flex;
  flex-direction: column;
}
.global-chat-panel.hidden { display: none; }

.global-chat-header {
  background: linear-gradient(135deg, var(--teal), #3D8FA5);
  color: var(--white);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.global-chat-header .toggle-chat-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.8;
  min-width: 32px;
  min-height: 32px;
}
.global-chat-header .toggle-chat-btn:hover { opacity: 1; }

.global-chat-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
}

.global-chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--section-bg);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.global-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.84rem;
  outline: none;
  font-family: var(--font-sans);
}
.global-chat-input:focus { border-color: var(--teal); }
.global-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  transition: var(--transition);
}
.global-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Sidebar AI chat button highlight */
.sidebar-ai-chat-btn {
  color: var(--teal) !important;
}
.sidebar-ai-chat-btn .sidebar-icon {
  font-size: 1.1rem;
}

/* ===== PC wide mode: Global Chat adjustments ===== */
@media (min-width: 768px) {
  /* PC ワイド表示（管理者・メンバー）: AI FABは非表示（サイドバーから起動） */
  body.admin-wide .global-chat-fab,
  body.member-wide .global-chat-fab {
    display: none !important;
  }
  body.admin-wide .global-chat-panel,
  body.member-wide .global-chat-panel {
    left: auto;
    bottom: 24px;
    right: 28px;
    width: 400px;
    max-height: 520px;
    border: 1px solid var(--border-light);
  }
  body.admin-wide .global-chat-header,
  body.member-wide .global-chat-header {
    padding: 16px 20px;
    font-size: 0.92rem;
  }
  body.admin-wide .global-chat-body,
  body.member-wide .global-chat-body {
    max-height: 360px;
    padding: 16px;
  }
  body.admin-wide .global-chat-body .chat-msg,
  body.member-wide .global-chat-body .chat-msg {
    font-size: 0.85rem;
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.6;
  }
}

/* ===== Print ===== */
@media print {
  body { background: white; max-width: 100%; }
  .app-header { position: static; box-shadow: none; }
  .bottom-nav { display: none !important; }
  .modal-overlay, .loading-overlay, .login-overlay { display: none !important; }
  .report-fab { display: none !important; }
  .global-chat-fab, .global-chat-panel { display: none !important; }
  .page-container { padding-bottom: 0; }
}

/* =================================================================
   STAFF CHAT STYLES
   ================================================================= */

/* --- Chat Page Header --- */
.chat-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.chat-header-actions {
  display: flex;
  gap: 8px;
}
.chat-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.chat-new-btn:hover {
  background: var(--primary-green-hover);
}

/* --- Chat Empty State --- */
.chat-empty {
  text-align: center;
  padding: 48px 24px;
}
.chat-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}
.chat-empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin-bottom: 8px;
}
.chat-empty-desc {
  font-size: 0.875rem;
  color: var(--medium-brown);
  line-height: 1.6;
}

/* --- Conversation List Item --- */
.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}
.chat-conv-item:hover {
  background: var(--primary-green-light);
}
.chat-conv-item.unread {
  background: rgba(13,158,79,0.04);
}
.chat-conv-item.unread .chat-conv-name {
  font-weight: 700;
}
.chat-conv-item.unread .chat-conv-preview {
  font-weight: 600;
  color: var(--dark-brown);
}

/* Avatar */
.chat-conv-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.chat-conv-avatar.group {
  background: var(--teal);
}

/* Info */
.chat-conv-info {
  flex: 1;
  min-width: 0;
}
.chat-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.chat-conv-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-conv-time {
  font-size: 0.75rem;
  color: var(--light-brown);
  flex-shrink: 0;
  margin-left: 8px;
}
.chat-conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-conv-preview {
  font-size: 0.825rem;
  color: var(--medium-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-conv-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary-green);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Bottom Nav Chat Badge --- */
.nav-icon-chat {
  position: relative;
}
.chat-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #D43D3D;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Chat Detail Overlay (full-screen) --- */
.chat-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}
.chat-detail-overlay.open {
  transform: translateX(0);
}
.chat-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--primary-green);
  color: white;
  flex-shrink: 0;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
}
.chat-detail-header .back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}
.chat-detail-title {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Messages Container --- */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.chat-messages-loading {
  text-align: center;
  padding: 40px;
  color: var(--medium-brown);
  font-size: 0.9rem;
}
.chat-no-messages {
  text-align: center;
  padding: 40px 24px;
  color: var(--light-brown);
  font-size: 0.9rem;
}

/* Date Divider */
.chat-date-divider {
  text-align: center;
  padding: 12px 0;
}
.chat-date-divider span {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--medium-brown);
}

/* Message Bubble */
.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.chat-message.mine {
  flex-direction: row-reverse;
}
.chat-msg-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light-brown);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}
.chat-msg-bubble-wrap {
  max-width: 75%;
}
.chat-msg-sender {
  font-size: 0.7rem;
  color: var(--medium-brown);
  margin-bottom: 2px;
  padding-left: 4px;
}
.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  word-break: break-word;
  line-height: 1.5;
}
.chat-message.other .chat-msg-bubble {
  background: var(--white);
  color: var(--dark-brown);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}
.chat-message.mine .chat-msg-bubble {
  background: var(--primary-green);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg-text {
  font-size: 0.9rem;
}
.chat-msg-time {
  font-size: 0.65rem;
  color: var(--light-brown);
  margin-top: 2px;
  padding: 0 4px;
}
.chat-message.mine .chat-msg-time {
  text-align: right;
}

/* --- Chat Input Area --- */
.chat-input-area {
  flex-shrink: 0;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--border-light);
}
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.4;
  font-family: var(--font-sans);
}
.chat-input:focus {
  border-color: var(--primary-green);
}
.chat-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary-green);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.chat-send-btn:hover {
  background: var(--primary-green-hover);
}

/* ============================================================
   Project Chat (STEP 3 — プロジェクトごとのチャット)
   ============================================================ */

/* プロジェクトカードのチャットボタン */
.pcm-chat-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-green);
  background: rgba(0, 153, 51, 0.08);
  border: 1px solid rgba(0, 153, 51, 0.25);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.pcm-chat-btn:hover {
  background: rgba(0, 153, 51, 0.16);
}
.pcm-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 8px;
  background: #D43D3D;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
}

/* メンバー一覧バー（チャット画面上部・常設表示） */
.pc-members-bar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
}
.pc-members-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--medium-brown);
  margin-right: 2px;
}
.pc-member-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 11px;
  background: rgba(0, 153, 51, 0.10);
  color: var(--primary-green);
  font-size: 0.72rem;
  font-weight: 600;
}
.pc-member-chip.pc-member-empty {
  background: rgba(0, 0, 0, 0.05);
  color: var(--light-brown);
  font-weight: 500;
}

/* システムメッセージ（メンバー加入等の中央寄せ注記） */
.pc-system-message {
  text-align: center;
  margin: 10px auto;
  padding: 4px 14px;
  max-width: 85%;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  font-size: 0.74rem;
  color: var(--medium-brown);
}

/* ============================================================
   Project Chat 添付（STEP 4 — 写真・ファイル添付）
   ============================================================ */

/* 添付ボタン（入力欄左の📎） */
.pc-attach-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.pc-attach-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.pc-attach-input {
  display: none;
}

/* メッセージ内の添付（共通） */
.pc-attachment {
  cursor: pointer;
  margin-bottom: 6px;
}

/* 画像添付サムネイル */
.pc-attachment-image {
  display: inline-block;
  max-width: 220px;
  border-radius: 10px;
  overflow: hidden;
}
.pc-attachment-thumb {
  display: block;
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}
.pc-attachment-thumb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 90px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-size: 0.72rem;
  color: var(--medium-brown);
}

/* 非画像ファイル添付 */
.pc-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  max-width: 240px;
}
.chat-message.mine .pc-attachment-file {
  background: rgba(255, 255, 255, 0.18);
}
.pc-attachment-file-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.pc-attachment-file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.pc-attachment-file-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-attachment-file-size {
  font-size: 0.66rem;
  opacity: 0.75;
}
.pc-attachment-file-dl {
  flex-shrink: 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* 送信前の添付プレビュー */
.pc-attach-preview {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 6px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.pc-attach-preview-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.pc-attach-preview-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.pc-attach-preview-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.pc-attach-preview-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-attach-preview-size {
  font-size: 0.66rem;
  color: var(--medium-brown);
}
.pc-attach-preview-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: var(--medium-brown);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.pc-attach-preview-remove:hover {
  background: rgba(0, 0, 0, 0.15);
}
.pc-attach-preview-uploading {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 6px;
  padding: 8px 12px;
  background: rgba(0, 153, 51, 0.06);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--primary-green);
}
.pc-attach-preview-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 153, 51, 0.25);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: pc-spin 0.8s linear infinite;
}
@keyframes pc-spin {
  to { transform: rotate(360deg); }
}

/* 画像の原寸プレビューオーバーレイ */
.pc-image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
.pc-image-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* --- New Chat Dialog --- */
.chat-new-dialog {
  padding: 16px;
}
.chat-new-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
}
.chat-new-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--medium-brown);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.chat-new-tab.active {
  color: var(--primary-green);
  border-bottom-color: var(--primary-green);
}
.chat-new-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--medium-brown);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.chat-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.chat-member-item:hover {
  background: var(--primary-green-light);
}
.chat-member-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}
.chat-member-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark-brown);
}
.chat-member-arrow {
  color: var(--light-brown);
  font-size: 0.8rem;
}
.chat-member-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.chat-member-check:hover {
  background: var(--primary-green-light);
}
.chat-member-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-green);
}
.chat-create-group-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.chat-create-group-btn:hover {
  background: var(--primary-green-hover);
}

/* --- Admin Wide sidebar chat badge --- */
.sidebar-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #D43D3D;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: auto;
}

/* ===== Staff Management ===== */
.staff-table td { vertical-align: middle; }
.staff-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-green-light);
  color: var(--primary-green);
}
.staff-status-label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}
.staff-enabled { color: var(--status-done); }
.staff-disabled { color: var(--status-hold); }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  vertical-align: middle;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary-green);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}
