/* ============================================================
   グループウェア 基本スタイルシート
   app.css - CSS Custom Properties ベース
============================================================ */

/* ------------------------------------------------------------
   CSS変数（カラーパレット）
------------------------------------------------------------ */
:root {
  --color-primary:    #3b82f6;
  --color-primary-dk: #1d4ed8;
  --color-secondary:  #6b7280;
  --color-success:    #22c55e;
  --color-warning:    #f59e0b;
  --color-danger:     #ef4444;
  --color-bg:         #f3f4f6;
  --color-surface:    #ffffff;
  --color-border:     #e5e7eb;
  --color-text:       #111827;
  --color-text-muted: #6b7280;
  --sidebar-width:    220px;
  --header-height:    56px;
  --radius:           8px;
  --shadow:           0 1px 3px rgba(0,0,0,.1);
  --shadow-md:        0 4px 12px rgba(0,0,0,.12);
  --font-sans:        'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

/* ------------------------------------------------------------
   リセット・ベース
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ------------------------------------------------------------
   グローバルヘッダー
------------------------------------------------------------ */
.gw-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.gw-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 1.25rem;
}
.gw-header__logo { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.gw-header__actions { display: flex; align-items: center; gap: .75rem; }
.gw-header__icon-btn {
  position: relative; padding: .4rem .6rem;
  background: none; border: none; cursor: pointer; font-size: 1.2rem;
}
.gw-header__user-btn {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: 1px solid var(--color-border);
  border-radius: 9999px; padding: .3rem .7rem; cursor: pointer; font-size: .9rem;
}
.gw-header__user-btn:hover { background: var(--color-bg); }

/* ------------------------------------------------------------
   レイアウト（サイドバー + メイン）
------------------------------------------------------------ */
.gw-layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}
.gw-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1rem 0;
}
.gw-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-height));
}

/* ------------------------------------------------------------
   サイドバーメニュー
------------------------------------------------------------ */
.gw-sidebar__menu { list-style: none; }
.gw-sidebar__item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem; color: var(--color-text);
  border-radius: 0 9999px 9999px 0; margin-right: .5rem;
  transition: background .15s;
}
.gw-sidebar__item:hover  { background: var(--color-bg); text-decoration: none; }
.gw-sidebar__item.is-active { background: #eff6ff; color: var(--color-primary); font-weight: 600; }
.gw-sidebar__icon  { font-size: 1.1rem; }
.gw-sidebar__label { font-size: .9rem; }
.gw-sidebar__divider { border-top: 1px solid var(--color-border); margin: .5rem 0; }

/* ------------------------------------------------------------
   カード
------------------------------------------------------------ */
.gw-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.gw-card__header {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}
.gw-card__title { font-size: 1rem; font-weight: 600; flex: 1; }
.gw-card__icon  { font-size: 1.1rem; }
.gw-card__link  { font-size: .8rem; color: var(--color-primary); margin-left: auto; }
.gw-card__body  { padding: 1rem 1.25rem; }
.gw-card__body--center { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.gw-card__footer { padding: .75rem 1.25rem; border-top: 1px solid var(--color-border); }
.gw-card--full-width { grid-column: 1 / -1; }
.gw-card--alert { border-left: 4px solid var(--color-warning); }
.gw-card--action { border: 2px solid var(--color-primary); }

/* ------------------------------------------------------------
   ページヘッダー
------------------------------------------------------------ */
.gw-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.gw-page-title { font-size: 1.3rem; font-weight: 700; }
.gw-page-date  { color: var(--color-text-muted); font-size: .9rem; }

/* ------------------------------------------------------------
   ボタン
------------------------------------------------------------ */
.gw-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .5rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  font-size: .9rem; font-family: inherit; font-weight: 500;
  transition: opacity .15s, background .15s;
  text-decoration: none;
}
.gw-btn:hover { opacity: .85; }
.gw-btn--primary   { background: var(--color-primary);   color: #fff; border-color: var(--color-primary); }
.gw-btn--secondary { background: #e0e7ff; color: var(--color-primary); }
.gw-btn--warning   { background: var(--color-warning);   color: #fff; }
.gw-btn--danger    { background: var(--color-danger);    color: #fff; }
.gw-btn--ghost     { background: transparent; color: var(--color-secondary); border-color: var(--color-border); }
.gw-btn--full { width: 100%; justify-content: center; }
.gw-btn--sm   { padding: .3rem .7rem; font-size: .8rem; }
.gw-btn--xs   { padding: .15rem .5rem; font-size: .75rem; }
.gw-btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------
   フォーム
------------------------------------------------------------ */
.gw-form__group   { margin-bottom: 1rem; }
.gw-form__row     { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gw-form__label   { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--color-text); }
.gw-form__input, .gw-form__select, .gw-form__textarea {
  width: 100%; padding: .55rem .75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  background: var(--color-surface); color: var(--color-text);
  transition: border-color .15s;
}
.gw-form__input:focus, .gw-form__select:focus, .gw-form__textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.gw-form__input--otp { letter-spacing: .5em; text-align: center; font-size: 1.4rem; }
.gw-form__hint   { font-size: .78rem; color: var(--color-text-muted); margin-top: .25rem; }
.gw-form__actions { display: flex; gap: .75rem; padding-top: .5rem; }
.gw-form__group--inline { display: flex; align-items: center; }
.gw-checkbox, .gw-radio { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.gw-radio-group { display: flex; gap: 1rem; }
.gw-checkbox-grid { display: flex; flex-wrap: wrap; gap: .4rem .75rem; padding: .5rem 0; }
.gw-required { color: var(--color-danger); }

/* ------------------------------------------------------------
   テーブル
------------------------------------------------------------ */
.gw-table-wrap { overflow-x: auto; }
.gw-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.gw-table th, .gw-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--color-border); text-align: left; }
.gw-table th { background: var(--color-bg); font-weight: 600; font-size: .82rem; color: var(--color-text-muted); }
.gw-table tr:hover td { background: #f9fafb; }

/* ------------------------------------------------------------
   タブ
------------------------------------------------------------ */
.gw-tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 2px solid var(--color-border); }
.gw-tabs__item {
  padding: .5rem 1rem; font-size: .9rem; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.gw-tabs__item.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ------------------------------------------------------------
   バッジ・タグ・ステータス
------------------------------------------------------------ */
.gw-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--color-danger); color: #fff;
  border-radius: 9999px; font-size: .7rem; font-weight: 700;
}
.gw-tag {
  display: inline-block; padding: .15rem .5rem;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 9999px; font-size: .75rem;
}
.gw-tag--important { background: #fef2f2; border-color: var(--color-danger); color: var(--color-danger); }
.gw-tag--pin       { background: #fffbeb; border-color: var(--color-warning); color: #92400e; }
.gw-tag--sm        { font-size: .7rem; padding: .1rem .4rem; }
.gw-status {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 9999px; font-size: .78rem; font-weight: 600;
}
.gw-status--gray   { background: #f3f4f6; color: #6b7280; }
.gw-status--yellow { background: #fef3c7; color: #92400e; }
.gw-status--green  { background: #dcfce7; color: #166534; }
.gw-status--red    { background: #fef2f2; color: #991b1b; }
.gw-status--blue   { background: #eff6ff; color: #1d4ed8; }

/* ------------------------------------------------------------
   アラート
------------------------------------------------------------ */
.gw-alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: .9rem;
}
.gw-alert--success { background: #dcfce7; color: #166534; }
.gw-alert--error   { background: #fef2f2; color: #991b1b; cursor: pointer; }
.gw-alert--warning { background: #fef3c7; color: #92400e; }
.gw-alert__close   { background: none; border: none; cursor: pointer; font-size: 1.1rem; }

/* ------------------------------------------------------------
   モーダル
------------------------------------------------------------ */
.gw-modal { display: none; position: fixed; inset: 0; z-index: 200; }
.gw-modal.is-open { display: flex; align-items: center; justify-content: center; }
.gw-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.gw-modal__dialog {
  position: relative; background: var(--color-surface);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  width: 100%; max-width: 540px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.gw-modal__dialog--lg { max-width: 720px; }
.gw-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border);
}
.gw-modal__title  { font-size: 1rem; font-weight: 700; }
.gw-modal__close  { background: none; border: none; cursor: pointer; font-size: 1.2rem; }
.gw-modal__body   { padding: 1.25rem; overflow-y: auto; flex: 1; min-height: 0; }
.gw-modal__footer { padding: 1rem 1.25rem; border-top: 1px solid var(--color-border); display: flex; gap: .5rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------
   ドロップダウン
------------------------------------------------------------ */
.gw-dropdown { position: relative; }
.gw-dropdown__menu {
  display: none; position: absolute; right: 0; top: 110%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  list-style: none; min-width: 180px; z-index: 150;
}
.gw-dropdown__menu.is-open { display: block; }
.gw-dropdown__menu li a,
.gw-dropdown__menu li button {
  display: block; width: 100%; padding: .6rem 1rem;
  background: none; border: none; text-align: left; cursor: pointer;
  font-size: .9rem; color: var(--color-text);
}
.gw-dropdown__menu li a:hover,
.gw-dropdown__menu li button:hover { background: var(--color-bg); }
.gw-dropdown__divider { border-top: 1px solid var(--color-border); margin: .25rem 0; }

/* ------------------------------------------------------------
   認証画面
------------------------------------------------------------ */
.gw-auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f3f4f6 100%);
}
.gw-auth-card {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 2rem; width: 100%; max-width: 420px;
}
.gw-auth-card--wide { max-width: 560px; }
.gw-auth-card__title { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: .5rem; }
.gw-auth-card__desc  { color: var(--color-text-muted); text-align: center; margin-bottom: 1.5rem; font-size: .9rem; }
.gw-auth-card__links { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: .85rem; }

/* ------------------------------------------------------------
   ダッシュボード
------------------------------------------------------------ */
.gw-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.gw-dash-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}
.gw-dash-row--tc-members {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}
.gw-stat { display: flex; align-items: baseline; gap: .3rem; justify-content: center; }
.gw-stat__num { font-size: 2.5rem; font-weight: 700; }
.gw-stat__num--alert { color: var(--color-danger); }
.gw-stat__label { color: var(--color-text-muted); }
.gw-event-list, .gw-post-list { list-style: none; }
.gw-event-list__item { display: flex; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--color-border); }
.gw-event-list__item:last-child { border-bottom: none; }
.gw-event-list__time { color: var(--color-text-muted); font-size: .85rem; white-space: nowrap; }
.gw-post-list__item { padding: .4rem 0; border-bottom: 1px solid var(--color-border); }
.gw-post-list__title { display: block; font-size: .9rem; }
.gw-post-list__meta  { font-size: .78rem; color: var(--color-text-muted); }
.gw-timeline-list { list-style: none; }
.gw-timeline-list__item { display: flex; gap: .75rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--color-border); }
.gw-timeline-list__desc  { font-size: .9rem; }
.gw-timeline-list__time  { font-size: .78rem; color: var(--color-text-muted); margin-left: auto; white-space: nowrap; }

/* ------------------------------------------------------------
   カレンダー
------------------------------------------------------------ */
.gw-calendar-wrap { background: var(--color-surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }

/* スコープ切り替えタブ */
.gw-scope-tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
  margin-bottom: .75rem;
}
.gw-scope-tabs--sm {
  margin: 0; margin-left: auto; margin-right: .5rem;
}
.gw-scope-tab {
  padding: .28rem .75rem;
  font-size: .8rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.gw-scope-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.gw-scope-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
[data-theme="dark"] .gw-scope-tab {
  background: var(--color-surface);
}

/* メンバー在席状況 */
.gw-dash-members-filter {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-bottom: .75rem;
}
.gw-dash-members-filter .gw-scope-tabs { margin: 0; }
.gw-dash-members-list {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.gw-member-chip {
  display: flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  font-size: .78rem;
  line-height: 1.3;
}
.gw-member-chip__name { white-space: nowrap; }
.gw-member-chip__status {
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
}
.gw-member-chip--present { border-color: var(--color-success); }
.gw-member-chip--present .gw-member-chip__status { color: var(--color-success); }
.gw-member-chip--out { border-color: var(--color-warning); }
.gw-member-chip--out .gw-member-chip__status { color: var(--color-warning); }
.gw-member-chip--left,
.gw-member-chip--before {
  opacity: .65;
}
.gw-member-chip--left .gw-member-chip__status,
.gw-member-chip--before .gw-member-chip__status {
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   チャット
------------------------------------------------------------ */
.gw-chat-layout { display: flex; height: calc(100vh - var(--header-height) - 3rem); }
.gw-chat-sidebar { width: 260px; flex-shrink: 0; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; }
.gw-chat-sidebar__header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--color-border); }
.gw-chat-sidebar__title  { font-weight: 700; }
.gw-chat-sidebar__search { padding: .5rem; }
.gw-chat-sidebar__room-name { padding: 1rem; font-weight: 600; border-bottom: 1px solid var(--color-border); }
.gw-room-list { list-style: none; overflow-y: auto; flex: 1; }
.gw-room-list__item { border-bottom: 1px solid var(--color-border); display: flex; align-items: stretch; position: relative; }
.gw-room-list__item.is-pinned { background: rgba(var(--color-primary-rgb, 59 130 246) / .04); }
.gw-room-list__link { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; color: var(--color-text); flex: 1; min-width: 0; }
.gw-room-list__link:hover { background: var(--color-bg); text-decoration: none; }
.gw-room-list__info { flex: 1; overflow: hidden; }
.gw-room-list__name { display: block; font-weight: 600; font-size: .9rem; }
.gw-room-list__last { display: block; font-size: .78rem; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-room-list__actions { display: none; align-items: center; gap: 2px; padding: 0 .4rem; flex-shrink: 0; }
.gw-room-list__item:hover .gw-room-list__actions { display: flex; }
.gw-room-action-btn { background: none; border: none; cursor: pointer; font-size: .9rem; padding: .3rem; border-radius: var(--radius); opacity: .5; line-height: 1; }
.gw-room-action-btn:hover { opacity: 1; background: var(--color-border); }
.gw-room-action-btn.is-active { opacity: 1; }
.gw-room-action-btn--danger:hover { background: #fee2e2; }
.gw-theme-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.gw-theme-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .75rem; transition: transform .1s; }
.gw-theme-swatch:hover { transform: scale(1.15); }
.gw-theme-swatch.is-selected { border-color: var(--color-text); transform: scale(1.15); }
.gw-chat-main { flex: 1; display: flex; flex-direction: column; }
.gw-chat-main--empty { align-items: center; justify-content: center; color: var(--color-text-muted); }
.gw-chat-main__header { padding: .75rem 1rem; border-bottom: 1px solid var(--color-border); font-weight: 700; }
.gw-chat-main__desc { font-size: .78rem; color: var(--color-text-muted); margin: .15rem 0 0; font-weight: 400; }
.gw-msg-box { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.gw-msg { display: flex; flex-direction: column; max-width: 70%; }
.gw-msg--mine  { align-self: flex-end; align-items: flex-end; }
.gw-msg--other { align-self: flex-start; }
.gw-msg__meta  { display: flex; gap: .4rem; font-size: .75rem; color: var(--color-text-muted); margin-bottom: .2rem; }
.gw-msg__bubble { padding: .6rem .9rem; border-radius: 1rem; font-size: .9rem; word-break: break-word; }
.gw-msg--mine  .gw-msg__bubble { background: var(--color-primary); color: #fff; border-bottom-right-radius: .2rem; }
.gw-msg--other .gw-msg__bubble { background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: .2rem; }
.gw-chat-form { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--color-border); background: var(--color-surface); }
.gw-chat-form__attach { cursor: pointer; font-size: 1.2rem; padding: .4rem; }
.gw-chat-form__input { flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--radius); padding: .55rem .75rem; font-family: inherit; font-size: .9rem; max-height: 120px; }
.gw-member-list { list-style: none; padding: .5rem; overflow-y: auto; }
.gw-member-list__item { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; font-size: .85rem; }

/* ------------------------------------------------------------
   申請フロー
------------------------------------------------------------ */
.gw-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; }
.gw-flow { list-style: none; }
.gw-flow__step { display: flex; gap: .75rem; padding: .6rem 0; position: relative; }
.gw-flow__step:not(:last-child)::before {
  content: ''; position: absolute; left: .55rem; top: 2rem; bottom: -.6rem;
  width: 2px; background: var(--color-border);
}
.gw-flow__step.is-done::before { background: var(--color-success); }
.gw-flow__marker { width: 1.25rem; text-align: center; flex-shrink: 0; }
.gw-flow__label  { font-size: .9rem; font-weight: 600; }
.gw-flow__history { font-size: .8rem; color: var(--color-text-muted); margin-top: .2rem; }
.gw-flow__comment { font-style: italic; margin-top: .2rem; }

/* ------------------------------------------------------------
   掲示板
------------------------------------------------------------ */
.gw-board-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gw-board-card { display: block; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; color: var(--color-text); transition: box-shadow .15s; }
.gw-board-card:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.gw-board-card__name { font-weight: 700; margin-bottom: .3rem; }
.gw-board-card__desc { font-size: .85rem; color: var(--color-text-muted); margin-bottom: .5rem; }
.gw-board-card__meta { font-size: .8rem; color: var(--color-text-muted); }
.gw-post-row { display: block; padding: .85rem 1rem; border-bottom: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); }
.gw-post-row:hover { background: #f9fafb; text-decoration: none; }
.gw-post-row__flags  { margin-bottom: .2rem; }
.gw-post-row__title  { font-weight: 600; margin-bottom: .3rem; }
.gw-post-row__meta   { display: flex; gap: 1rem; font-size: .78rem; color: var(--color-text-muted); }
.gw-post-body        { font-size: .95rem; line-height: 1.8; }
.gw-comment { padding: .75rem 0; border-bottom: 1px solid var(--color-border); }
.gw-comment--nested { margin-left: 2rem; border-left: 3px solid var(--color-border); padding-left: 1rem; }
.gw-comment__header { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.gw-comment__author { font-weight: 600; font-size: .9rem; }
.gw-comment__date   { font-size: .78rem; color: var(--color-text-muted); }
.gw-comment__body   { font-size: .9rem; }

/* ------------------------------------------------------------
   タイムライン
------------------------------------------------------------ */
.gw-timeline { list-style: none; }
.gw-timeline__item { display: flex; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--color-border); position: relative; }
.gw-timeline__body { flex: 1; }
.gw-timeline__desc { font-size: .9rem; }
.gw-timeline__time { font-size: .78rem; color: var(--color-text-muted); }
.gw-timeline__actions { align-self: flex-start; }

/* ------------------------------------------------------------
   アバター
------------------------------------------------------------ */
.gw-avatar { border-radius: 50%; object-fit: cover; }
.gw-avatar--xs { width: 24px; height: 24px; }
.gw-avatar--sm { width: 32px; height: 32px; }
.gw-avatar--md { width: 48px; height: 48px; }
.gw-avatar-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff; font-weight: 700;
  border-radius: 50%;
}
.gw-avatar-placeholder.gw-avatar--xs { width: 24px; height: 24px; font-size: .7rem; }
.gw-avatar-placeholder.gw-avatar--sm { width: 32px; height: 32px; font-size: .85rem; }
.gw-avatar-placeholder.gw-avatar--md { width: 48px; height: 48px; font-size: 1.1rem; }

/* ------------------------------------------------------------
   ユーティリティ
------------------------------------------------------------ */
.gw-empty { text-align: center; color: var(--color-text-muted); padding: 2rem; }
.gw-dl    { display: grid; gap: .4rem; }
.gw-dl--grid { grid-template-columns: auto 1fr; column-gap: 1.5rem; }
.gw-dl dt { font-weight: 600; color: var(--color-text-muted); font-size: .85rem; }
.gw-file-list { list-style: none; }
.gw-file-list__item { padding: .35rem 0; }
.gw-file-list__link { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.gw-file-list__size { color: var(--color-text-muted); font-size: .78rem; }
.gw-breadcrumb { color: var(--color-text-muted); font-size: .85rem; }
.gw-section-title { font-weight: 700; font-size: 1rem; margin: 1.25rem 0 .75rem; }
.gw-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.gw-pagination__page { color: var(--color-text-muted); font-size: .9rem; }

/* ------------------------------------------------------------
   レスポンシブ
------------------------------------------------------------ */
/* ------------------------------------------------------------
   ハンバーガーボタン（モバイル専用）
------------------------------------------------------------ */
.gw-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .4rem; font-size: 1.4rem; color: var(--color-text);
  line-height: 1;
}

/* サイドバーオーバーレイ（モバイルのみ） */
.gw-sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 149;
  background: rgba(0,0,0,.4);
}
.gw-sidebar-overlay.is-open { display: block; }

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .gw-hamburger { display: block; }

  /* サイドバーをスライドイン方式に */
  .gw-sidebar {
    display: block !important;
    position: fixed;
    top: var(--header-height); left: 0; bottom: 0;
    width: 240px; z-index: 150;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
  }
  .gw-sidebar.is-open { transform: translateX(0); }

  .gw-main    { margin-left: 0; padding: 1rem; }
  .gw-form__row { grid-template-columns: 1fr; }
  .gw-detail-layout { grid-template-columns: 1fr; }
  .gw-dashboard-grid { grid-template-columns: 1fr; }
  .gw-dash-row--tc-members { grid-template-columns: 1fr; }
  .gw-chat-sidebar { display: none; }
}

/* ------------------------------------------------------------
   施設予約 週間グリッド
------------------------------------------------------------ */
.gw-facility-tabs {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem;
}
.gw-facility-tab {
  padding: .4rem 1rem; border-radius: 9999px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  cursor: pointer; font-size: .9rem; font-family: inherit;
  color: var(--color-text);
}
.gw-facility-tab.is-active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.gw-facility-tab__cap { font-size: .75rem; color: inherit; opacity: .75; }
.gw-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.gw-week-nav__range { font-weight: 600; }
.gw-week-wrap { overflow-x: auto; }
.gw-week-grid {
  display: flex; min-width: 700px;
  background: var(--color-surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.gw-week-time-col { width: 52px; flex-shrink: 0; border-right: 1px solid var(--color-border); }
.gw-week-day-col  { flex: 1; border-right: 1px solid var(--color-border); position: relative; overflow: hidden; }
.gw-week-day-col:last-child { border-right: none; }
.gw-week-day-col.is-today { background: #fffbeb; }
.gw-week-header-cell {
  height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.gw-week-header-cell.is-sat { color: #1d4ed8; }
.gw-week-header-cell.is-sun { color: var(--color-danger); }
.gw-week-time-cell {
  height: 48px; display: flex; align-items: flex-start; justify-content: center;
  font-size: .72rem; color: var(--color-text-muted); padding-top: 4px;
  border-bottom: 1px solid var(--color-border);
}
.gw-week-slot {
  height: 48px; border-bottom: 1px solid var(--color-border);
  cursor: pointer; transition: background .1s;
}
.gw-week-slot:hover { background: #eff6ff; }
.gw-res-block {
  position: absolute; left: 2px; right: 2px;
  background: #6366f1; color: #fff; border-radius: 4px;
  padding: 2px 6px; font-size: .75rem; cursor: pointer;
  overflow: hidden; z-index: 10;
}
.gw-res-block__facility { display: block; font-size: .68rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-res-block__title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-res-block__time  { display: block; font-size: .7rem; opacity: .85; }
.gw-res-block { cursor: grab; user-select: none; }
.gw-res-block.gw-dragging { opacity: .35; cursor: grabbing; }

/* ドラッグ新規作成プレビュー */
.gw-drag-preview {
  position: absolute; left: 2px; right: 2px;
  background: rgba(99,102,241,0.18);
  border: 2px dashed #6366f1;
  border-radius: 4px;
  z-index: 8;
  pointer-events: none;
}

/* ドラッグ中のグリッド列 */
.gw-week-day-col { user-select: none; }
.gw-week-slot { cursor: cell; }

/* ------------------------------------------------------------
   精算
------------------------------------------------------------ */
.gw-settlement-item { margin-bottom: .75rem; }
.gw-item-row {
  display: flex; gap: .5rem; align-items: flex-start;
  padding: 1rem; background: var(--color-bg);
  border-radius: var(--radius); border: 1px solid var(--color-border);
}
.gw-item-row__fields {
  display: grid;
  grid-template-columns: 140px 1fr 130px 130px 1fr;
  gap: .5rem; flex: 1;
}
.gw-settlement-total {
  text-align: right; font-size: 1.1rem;
  padding: .75rem 0; border-top: 2px solid var(--color-border);
  margin: .5rem 0 1rem;
}
.gw-amount      { font-variant-numeric: tabular-nums; }
.gw-amount--lg  { font-size: 1.2rem; font-weight: 700; }
.gw-text--right { text-align: right; }
.gw-text--warning { color: var(--color-warning); }
.gw-table__total td { background: var(--color-bg); border-top: 2px solid var(--color-border); }

@media (max-width: 768px) {
  .gw-item-row__fields { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   管理者画面
------------------------------------------------------------ */
.gw-admin-layout {
  display: flex; gap: 1.5rem;
}
.gw-admin-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  align-self: flex-start;
  position: sticky; top: calc(var(--header-height) + 1.5rem);
}
.gw-admin-sidebar__title {
  font-size: .8rem; font-weight: 700; color: var(--color-text-muted);
  padding: 0 1rem .5rem; letter-spacing: .05em; text-transform: uppercase;
}
.gw-admin-sidebar__menu { list-style: none; }
.gw-admin-sidebar__item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; font-size: .88rem; color: var(--color-text);
  border-radius: 0 9999px 9999px 0; margin-right: .5rem;
}
.gw-admin-sidebar__item:hover  { background: var(--color-bg); text-decoration: none; }
.gw-admin-sidebar__item.is-active { background: #eff6ff; color: var(--color-primary); font-weight: 600; }
.gw-admin-sidebar__divider { border-top: 1px solid var(--color-border); margin: .5rem 0; }
.gw-admin-main { flex: 1; min-width: 0; }
.gw-search-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.gw-search-bar__input  { flex: 1; }
.gw-search-bar__select { width: 160px; }
.gw-row--disabled td { opacity: .5; }
.gw-user-cell { display: flex; align-items: center; gap: .5rem; }
.gw-text--muted { color: var(--color-text-muted); }
.gw-text--sm    { font-size: .82rem; }
.gw-text--xs    { font-size: .7rem; }
.gw-code { background: var(--color-bg); padding: .1rem .4rem; border-radius: 4px; font-family: monospace; font-size: .85rem; }
.gw-route-list  { display: flex; flex-direction: column; gap: 1rem; }
.gw-step-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; background: var(--color-bg);
  border-radius: var(--radius); margin-bottom: .5rem;
}
.gw-step-row__order { font-weight: 700; white-space: nowrap; min-width: 52px; font-size: .85rem; }
.gw-tab-panel { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------
   プロフィール
------------------------------------------------------------ */
.gw-profile-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; }
.gw-profile-avatar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.gw-avatar--lg { width: 72px; height: 72px; font-size: 1.6rem; }
.gw-profile-readonly {
  margin-top: 1rem; padding: 1rem;
  background: var(--color-bg); border-radius: var(--radius);
  display: grid; gap: .5rem;
}
.gw-profile-readonly__item { display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
.gw-profile-readonly__label { color: var(--color-text-muted); min-width: 80px; font-size: .85rem; }
@media (max-width: 768px) { .gw-profile-layout { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------
   通知
------------------------------------------------------------ */
.gw-notification-list { display: flex; flex-direction: column; gap: .5rem; }
.gw-notification {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 4px solid transparent;
}
.gw-notification--unread { border-left-color: var(--color-primary); background: #f0f7ff; }
.gw-notification__body   { flex: 1; }
.gw-notification__title  { font-weight: 600; margin-bottom: .25rem; }
.gw-notification__text   { font-size: .88rem; color: var(--color-text-muted); margin-bottom: .3rem; }
.gw-notification__time   { font-size: .78rem; color: var(--color-text-muted); }
.gw-notification__actions { display: flex; gap: .5rem; flex-shrink: 0; align-items: center; }

/* ------------------------------------------------------------
   フォーム内パディング調整
------------------------------------------------------------ */
.gw-card .gw-form {
  padding: 1.25rem;
}
.gw-card .gw-form .gw-form__group:last-of-type {
  margin-bottom: 0;
}
.gw-card .gw-form .gw-form__actions {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: .5rem;
}

/* ------------------------------------------------------------
   カーソル：リンク・ボタンを指アイコンに統一
------------------------------------------------------------ */
a,
button,
[role="button"],
.gw-btn,
.gw-tabs__item,
.gw-sidebar__item,
.gw-room-list__link,
.gw-post-row,
.gw-board-card,
.gw-facility-tab,
.gw-flow__step,
.gw-week-slot,
.gw-res-block,
.gw-modal__close,
.gw-dropdown__menu li a,
.gw-dropdown__menu li button {
  cursor: pointer;
}

/* ------------------------------------------------------------
   モーダル：コンテンツがはみ出さないようにする
------------------------------------------------------------ */
.gw-modal__dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.gw-modal__dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.gw-modal__body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.gw-modal__footer {
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   アバター画像：object-fit でトリミング
------------------------------------------------------------ */
.gw-avatar {
  object-fit: cover;
  border-radius: 50%;
}
.gw-avatar--lg {
  width: 72px;
  height: 72px;
}

/* ------------------------------------------------------------
   ダークテーマ
------------------------------------------------------------ */
[data-theme="dark"] {
  --color-primary:    #60a5fa;
  --color-primary-dk: #3b82f6;
  --color-secondary:  #9ca3af;
  --color-success:    #4ade80;
  --color-warning:    #fbbf24;
  --color-danger:     #f87171;
  --color-bg:         #111827;
  --color-surface:    #1f2937;
  --color-border:     #374151;
  --color-text:       #f9fafb;
  --color-text-muted: #9ca3af;
  --shadow:           0 1px 3px rgba(0,0,0,.4);
  --shadow-md:        0 4px 12px rgba(0,0,0,.5);
}
[data-theme="dark"] .gw-header {
  background: #1f2937;
  border-bottom-color: #374151;
}
[data-theme="dark"] .gw-sidebar {
  background: #1f2937;
  border-right-color: #374151;
}
[data-theme="dark"] .gw-sidebar__item.is-active {
  background: #1e3a5f;
}
[data-theme="dark"] .gw-form__input,
[data-theme="dark"] .gw-form__select,
[data-theme="dark"] .gw-form__textarea {
  background: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}
[data-theme="dark"] .gw-table th {
  background: #374151;
}
[data-theme="dark"] .gw-table tr:hover td {
  background: #374151;
}
[data-theme="dark"] .gw-post-row:hover {
  background: #374151;
}
[data-theme="dark"] .gw-auth-wrap {
  background: linear-gradient(135deg, #1e3a5f 0%, #111827 100%);
}
[data-theme="dark"] .gw-auth-card {
  background: #1f2937;
}
[data-theme="dark"] .gw-tabs__item.is-active {
  color: var(--color-primary);
}
[data-theme="dark"] .gw-status--gray {
  background: #374151;
  color: #9ca3af;
}
[data-theme="dark"] .gw-code {
  background: #374151;
  color: #f9fafb;
}
[data-theme="dark"] .fc {
  color: #f9fafb;
}
[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th,
[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
  border-color: #374151;
}
[data-theme="dark"] .fc-col-header-cell {
  background: #374151;
  color: #9ca3af;
}
[data-theme="dark"] .fc-daygrid-day:hover {
  background: #374151;
}

/* ダークテーマ切り替えボタン */
.gw-theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: .3rem .7rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text);
  transition: background .15s;
}
.gw-theme-toggle:hover {
  background: var(--color-bg);
}

/* ------------------------------------------------------------
   ダークモード追加修正
------------------------------------------------------------ */
/* ヘッダーボタン内テキスト */
[data-theme="dark"] .gw-header__user-btn {
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .gw-header__user-btn:hover {
  background: var(--color-border);
}
/* ドロップダウンメニュー */
[data-theme="dark"] .gw-dropdown__menu {
  background: #1f2937;
  border-color: #374151;
}
[data-theme="dark"] .gw-dropdown__menu li a,
[data-theme="dark"] .gw-dropdown__menu li button {
  color: var(--color-text);
}
[data-theme="dark"] .gw-dropdown__menu li a:hover,
[data-theme="dark"] .gw-dropdown__menu li button:hover {
  background: #374151;
}
/* カード・モーダル */
[data-theme="dark"] .gw-modal__dialog {
  background: #1f2937;
}
[data-theme="dark"] .gw-modal__overlay {
  background: rgba(0,0,0,.6);
}
[data-theme="dark"] .gw-card__footer {
  border-top-color: #374151;
}
/* アラート */
[data-theme="dark"] .gw-alert--success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .gw-alert--error   { background: #7f1d1d; color: #fca5a5; }

/* ------------------------------------------------------------
   カレンダー祝日・土日スタイル
------------------------------------------------------------ */
.fc-holiday {
  opacity: .7;
}
.fc-project-task .fc-event-main {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0)    0px,
    rgba(255,255,255,0)    5px,
    rgba(255,255,255,0.28) 5px,
    rgba(255,255,255,0.28) 9px
  );
}
.fc-daygrid-day.fc-day-sun .fc-daygrid-day-number { color: #ef4444; }
.fc-daygrid-day.fc-day-sat .fc-daygrid-day-number { color: #3b82f6; }
.fc-daygrid-day:not(.fc-day-sun):not(.fc-day-sat) .fc-daygrid-day-number { color: #6b7280; }
.fc-col-header-cell.fc-day-sun { color: #ef4444; }
.fc-col-header-cell.fc-day-sat { color: #3b82f6; }

[data-theme="dark"] .fc-daygrid-day.fc-day-sun { background: rgba(239,68,68,0.08); }
[data-theme="dark"] .fc-daygrid-day.fc-day-sat { background: rgba(59,130,246,0.08); }
[data-theme="dark"] .fc-holiday { background: rgba(251,191,36,0.1) !important; }

/* ------------------------------------------------------------
   カレンダー：今日・土日・祝日のスタイル修正
------------------------------------------------------------ */
/* 今日のセルの強調 */
.fc-day-today {
  background: rgba(59,130,246,0.08) !important;
}
[data-theme="dark"] .fc-day-today {
  background: rgba(96,165,250,0.15) !important;
}
.fc-day-today .fc-daygrid-day-number {
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
  font-size: .82rem;
  display: inline-block;
  line-height: 1.6;
  margin: 2px;
}
/* FullCalendar デフォルトの今日強調を無効化 */
.fc .fc-day-today .fc-daygrid-day-frame {
  background: transparent;
}
/* 週・日表示の今日列 */
.fc-timegrid-col.fc-day-today {
  background: rgba(59,130,246,0.05) !important;
}
/* 祝日は日曜と同じ赤系 */
.fc-holiday {
  opacity: .5;
}
/* 週・日表示の土日ヘッダー */
.fc-timegrid .fc-col-header-cell.fc-day-sun { color: #ef4444; }
.fc-timegrid .fc-col-header-cell.fc-day-sat { color: #3b82f6; }
/* ダークモード */
[data-theme="dark"] .fc-day-today {
  background: rgba(96,165,250,0.12) !important;
}
[data-theme="dark"] .fc-day-today .fc-daygrid-day-number {
  background: var(--color-primary);
  color: #fff !important;
}

/* ------------------------------------------------------------
   ダークモード：FullCalendar 今日セルの白背景を打ち消す
------------------------------------------------------------ */
[data-theme="dark"] .fc .fc-day-today {
  background-color: rgba(96,165,250,0.15) !important;
}
[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today {
  background-color: rgba(96,165,250,0.15) !important;
}
[data-theme="dark"] .fc .fc-timegrid-col.fc-day-today {
  background-color: rgba(96,165,250,0.08) !important;
}
/* FullCalendarのデフォルト今日色を完全に無効化してCSSで制御 */
.fc .fc-day-today {
  background-color: rgba(59,130,246,0.08) !important;
}

/* ------------------------------------------------------------
   ダークモード：週グリッドの時刻・ヘッダーセル
------------------------------------------------------------ */
[data-theme="dark"] .gw-week-header-cell {
  background: #374151;
  color: var(--color-text);
}
[data-theme="dark"] .gw-week-time-cell {
  color: var(--color-text-muted);
}
[data-theme="dark"] .gw-week-slot:hover {
  background: #374151;
}
[data-theme="dark"] .gw-week-day-col.is-today {
  background: rgba(96,165,250,0.08);
}

/* ------------------------------------------------------------
   モーダルフッター：ボタンの縦揃え強化
------------------------------------------------------------ */
.gw-modal__footer .gw-btn,
.gw-modal__footer button,
.gw-modal__footer a {
  vertical-align: middle;
}
.gw-modal__footer form {
  display: inline-flex;
  align-items: center;
}

/* ------------------------------------------------------------
   施設予約週グリッド：土日の文字色（ライト・ダーク共通）
------------------------------------------------------------ */
/* ヘッダーの日付 */
.gw-week-header-cell.is-sun { color: #ef4444 !important; }
.gw-week-header-cell.is-sat { color: #3b82f6 !important; }

/* ダークモードでも同じ色を維持 */
[data-theme="dark"] .gw-week-header-cell.is-sun { color: #f87171 !important; }
[data-theme="dark"] .gw-week-header-cell.is-sat { color: #60a5fa !important; }

/* 列の背景にも薄く色付け */
.gw-week-day-col:has(.gw-week-header-cell.is-sun) { background: rgba(239,68,68,0.03); }
.gw-week-day-col:has(.gw-week-header-cell.is-sat) { background: rgba(59,130,246,0.03); }

[data-theme="dark"] .gw-week-day-col:has(.gw-week-header-cell.is-sun) { background: rgba(239,68,68,0.06); }
[data-theme="dark"] .gw-week-day-col:has(.gw-week-header-cell.is-sat) { background: rgba(59,130,246,0.06); }

/* ------------------------------------------------------------
   通知バッジ：ベルアイコンの右上に配置
------------------------------------------------------------ */
.gw-header__icon-btn .gw-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  font-size: .65rem; padding: 0 4px;
  pointer-events: none;
}
/* サイドバーのバッジも調整 */
.gw-sidebar__item { position: relative; }
.gw-sidebar__item .gw-badge {
  position: absolute;
  top: 50%; right: .75rem;
  transform: translateY(-50%);
  min-width: 16px; height: 16px;
  font-size: .65rem; padding: 0 4px;
}

/* ------------------------------------------------------------
   チャット メンバー選択UI
------------------------------------------------------------ */
.gw-member-results {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  max-height: 200px;
  overflow-y: auto;
  margin-top: .25rem;
}
.gw-member-result-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; cursor: pointer;
  transition: background .1s;
}
.gw-member-result-item:hover { background: var(--color-bg); }
.gw-member-result-empty { padding: .5rem .75rem; color: var(--color-text-muted); font-size: .85rem; }

.gw-member-chips {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-top: .5rem; min-height: 28px;
}
.gw-member-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--color-primary); color: #fff;
  border-radius: 9999px; padding: .2rem .6rem;
  font-size: .82rem;
}
.gw-member-chip__remove {
  background: none; border: none; color: #fff;
  cursor: pointer; font-size: .9rem; line-height: 1;
  padding: 0; margin-left: .1rem; opacity: .8;
}
.gw-member-chip__remove:hover { opacity: 1; }

.gw-member-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .25rem; border-bottom: 1px solid var(--color-border);
}
.gw-member-row:last-child { border-bottom: none; }
.gw-member-row__name { flex: 1; font-size: .9rem; }

[data-theme="dark"] .gw-member-results {
  background: #1f2937; border-color: #374151;
}
[data-theme="dark"] .gw-member-result-item:hover { background: #374151; }

/* ------------------------------------------------------------
   チャット：ルーム削除ボタン
------------------------------------------------------------ */
.gw-room-list__item {
  position: relative;
  display: flex;
  align-items: center;
}
.gw-room-delete-form {
  flex-shrink: 0;
  padding: 0 .5rem;
}
.gw-room-delete-btn {
  padding: .25rem .45rem; font-size: .85rem;
  background: none; border: 1px solid var(--color-border);
  border-radius: 4px; cursor: pointer; color: var(--color-text-muted);
  line-height: 1; display: block;
}
.gw-room-delete-btn:hover {
  background: var(--color-danger); color: #fff; border-color: var(--color-danger);
}

/* ------------------------------------------------------------
   ダッシュボード週間スケジュール
------------------------------------------------------------ */
/* ダッシュボード打刻パネル */
.gw-dash-tc-body  { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.gw-dash-tc-wt    { display: flex; align-items: center; gap: .5rem; }
.gw-dash-tc-wt__label { font-size: .8rem; color: var(--color-text-muted); white-space: nowrap; }
.gw-dash-tc-btns  { display: flex; gap: 1rem; flex-wrap: wrap; }
.gw-dash-tc-item  { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 56px; }
.gw-dash-tc-item__label { font-size: .72rem; color: var(--color-text-muted); }
.gw-dash-tc-item__val   { display: flex; align-items: center; justify-content: center; }
.gw-dash-tc-btn   { font-size: .82rem; padding: .3rem .7rem; }

.gw-dashboard-week-card {
  grid-column: 1 / -1; /* 横幅いっぱい */
}
.gw-dashboard-week-body {
  padding: 0;
  overflow: hidden;
}
.gw-dashboard-week-body .fc {
  font-size: .82rem;
}
.gw-dashboard-week-body .fc-timegrid-slot {
  height: 32px;
}
.gw-dashboard-week-body .fc-col-header-cell.fc-day-today {
  background: rgba(59,130,246,0.1);
  font-weight: 700;
}
.gw-dashboard-week-body .fc-timegrid-col.fc-day-today {
  background: rgba(59,130,246,0.04) !important;
}
[data-theme="dark"] .gw-dashboard-week-body .fc-col-header-cell.fc-day-today {
  background: rgba(96,165,250,0.15);
}

/* ------------------------------------------------------------
   お知らせバー（ダッシュボード上部）
------------------------------------------------------------ */
.gw-announce-bar {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .5rem .75rem;
  margin-bottom: 1.25rem;
}
.gw-announce-bar__label {
  flex-shrink: 0;
  font-size: .8rem; font-weight: 700;
  color: var(--color-primary);
  padding-top: .35rem;
  white-space: nowrap;
}
.gw-announce-bar__admin {
  flex-shrink: 0; align-self: flex-start; margin-top: .15rem;
}
.gw-announce-list {
  flex: 1; list-style: none; margin: 0; padding: 0;
}
.gw-announce-item {
  position: relative;
  border-top: 1px solid var(--color-border);
}
.gw-announce-item:first-child { border-top: none; }
.gw-announce-title {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; text-align: left;
  padding: .35rem .25rem;
  background: none; border: none; cursor: pointer;
  font-size: .875rem; font-family: inherit; color: var(--color-text);
  transition: color .15s;
}
.gw-announce-title:hover { color: var(--color-primary); }
.gw-announce-title__text { flex: 1; }
.gw-announce-title__date {
  flex-shrink: 0; font-size: .75rem; color: var(--color-text-muted);
}
.gw-announce-title__arrow {
  flex-shrink: 0; font-size: .6rem; color: var(--color-text-muted);
  transition: transform .2s; display: inline-block;
}
.gw-announce-item.is-open .gw-announce-title__arrow { transform: rotate(90deg); }
.gw-announce-body {
  display: none;
  padding: .5rem .5rem .75rem .5rem;
  font-size: .875rem;
  border-top: 1px solid var(--color-border);
}
/* ホバーポップアップ */
.gw-announce-popup {
  display: none;
  position: absolute; left: 0; z-index: 300;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  padding: .75rem 1rem;
  font-size: .85rem;
  min-width: 260px; max-width: 420px;
  max-height: 220px; overflow-y: auto;
  pointer-events: none;
}
/* HTML本文のスタイリング */
.gw-html-content h1, .gw-html-content h2, .gw-html-content h3 {
  margin: .75rem 0 .5rem; font-weight: 700;
}
.gw-html-content h1 { font-size: 1.4rem; }
.gw-html-content h2 { font-size: 1.2rem; }
.gw-html-content h3 { font-size: 1.05rem; }
.gw-html-content p  { margin: .5rem 0; line-height: 1.7; }
.gw-html-content ul, .gw-html-content ol { margin: .5rem 0 .5rem 1.5rem; }
.gw-html-content li { margin: .25rem 0; }
.gw-html-content a  { color: var(--color-primary); }
.gw-html-content strong { font-weight: 700; }
.gw-html-content em     { font-style: italic; }
.gw-html-content table  { border-collapse: collapse; width: 100%; margin: .75rem 0; }
.gw-html-content th, .gw-html-content td {
  border: 1px solid var(--color-border); padding: .4rem .75rem;
}
.gw-html-content th { background: var(--color-bg); font-weight: 600; }
.gw-html-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.gw-html-content blockquote {
  border-left: 3px solid var(--color-border);
  margin: .5rem 0; padding: .5rem 1rem;
  color: var(--color-text-muted);
}
[data-theme="dark"] .gw-html-content a { color: var(--color-primary); }

/* ------------------------------------------------------------
   Quill エディタ（ライト・ダーク共通）
------------------------------------------------------------ */
.ql-toolbar {
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
  border-radius: var(--radius) var(--radius) 0 0;
}
.ql-container {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: .95rem;
  min-height: 280px;
}
.ql-editor {
  min-height: 280px;
  color: var(--color-text) !important;
}
.ql-editor.ql-blank::before {
  color: var(--color-text-muted) !important;
}
/* ツールバーのアイコン・ドロップダウン（ライト） */
.ql-toolbar .ql-stroke { stroke: #374151 !important; }
.ql-toolbar .ql-fill   { fill:   #374151 !important; }
.ql-toolbar .ql-picker-label { color: #374151 !important; }
/* ダークモード：アイコンを明るく */
[data-theme="dark"] .ql-toolbar .ql-stroke { stroke: #e5e7eb !important; }
[data-theme="dark"] .ql-toolbar .ql-fill   { fill:   #e5e7eb !important; }
[data-theme="dark"] .ql-toolbar .ql-picker-label { color: #e5e7eb !important; }
[data-theme="dark"] .ql-toolbar .ql-picker-label .ql-stroke { stroke: #e5e7eb !important; }
/* ホバー・アクティブ */
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke { stroke: var(--color-primary) !important; }
.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill   { fill:   var(--color-primary) !important; }
.ql-toolbar .ql-picker-label:hover      { color: var(--color-primary) !important; }
/* ドロップダウンメニュー */
.ql-picker-options {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
.ql-picker-item { color: var(--color-text) !important; }
.ql-picker-item:hover { color: var(--color-primary) !important; }
/* ダークモード：ツールバー背景を少し明るく */
[data-theme="dark"] .ql-toolbar { background: #374151 !important; }
[data-theme="dark"] .ql-picker-options { background: #1f2937 !important; }

/* ------------------------------------------------------------
   タイムライン リンク
------------------------------------------------------------ */
.gw-timeline__link {
  color: var(--color-primary);
  text-decoration: none;
}
.gw-timeline__link:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   アイコンピッカー
------------------------------------------------------------ */
.gw-icon-picker {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .5rem; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  max-height: 120px; overflow-y: auto;
}
.gw-icon-btn {
  font-size: 1.3rem; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent; border-radius: 6px;
  cursor: pointer; background: none; transition: border-color .1s;
}
.gw-icon-btn:hover     { border-color: var(--color-border); background: var(--color-surface); }
.gw-icon-btn.is-selected { border-color: var(--color-primary); background: #eff6ff; }
[data-theme="dark"] .gw-icon-btn.is-selected { background: #1e3a5f; }

/* ------------------------------------------------------------
   ヘッダー中央：日付・組織情報
------------------------------------------------------------ */
.gw-header__center {
  display: flex; flex-direction: column; align-items: center;
  position: absolute; left: 50%; top: 50%;
  transform: translateX(-50%) translateY(-50%);
  pointer-events: none;
}
.gw-header__org {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  max-width: 420px;
}
.gw-header__org--with-logo {
  flex-direction: row; align-items: center; gap: .6rem;
}
.gw-header__company-name {
  font-size: .82rem; color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gw-header__company-logo {
  max-height: 36px; width: auto; display: block; object-fit: contain; flex-shrink: 0;
}
.gw-header__org-sub-row {
  display: flex; flex-direction: row; align-items: center; gap: .5rem;
}
.gw-header__org-sub {
  font-size: .78rem; color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .gw-header__center { display: none; }
  .gw-header__company-logo { max-height: 28px; }
}

/* ------------------------------------------------------------
   ヘッダーロゴ画像
------------------------------------------------------------ */
.gw-header__logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 768px) {
  .gw-header__logo-img { height: 28px; }
}

/* ------------------------------------------------------------
   ヘッダーロゴ：ライト・ダーク切り替え
------------------------------------------------------------ */
.gw-header__logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
/* ライトモード：lightを表示、darkを非表示 */
[data-theme="light"] .gw-logo--light,
html:not([data-theme="dark"]) .gw-logo--light { display: block; }
[data-theme="light"] .gw-logo--dark,
html:not([data-theme="dark"]) .gw-logo--dark  { display: none; }

/* ダークモード：darkを表示、lightを非表示 */
[data-theme="dark"] .gw-logo--light { display: none; }
[data-theme="dark"] .gw-logo--dark  { display: block; }

@media (max-width: 768px) {
  .gw-header__logo-img { height: 28px; }
}

/* ============================================================
   ガントチャート（プロジェクト管理）
============================================================ */
.gw-gantt {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gw-gantt__controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-wrap: wrap;
}

.gw-gantt__view-switcher { display: flex; gap: .25rem; }
.gw-gantt__nav          { display: flex; align-items: center; gap: .5rem; }
.gw-gantt__range-label  { font-weight: 600; font-size: .95rem; min-width: 140px; text-align: center; }
.gw-gantt__period-inputs { display: flex; align-items: center; gap: .5rem; }

.gw-gantt__body {
  display: flex;
  overflow: hidden;
  min-height: 400px;
  max-height: 70vh;
}

/* 左パネル */
.gw-gantt__left-panel {
  flex: 0 0 360px;
  min-width: 0;
  border-right: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gw-gantt__col-header {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: .8rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  height: 52px;
  flex-shrink: 0;
}

.gw-gantt__col-task     { flex: 1; padding: 0 .5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-gantt__col-dates    { width: 90px; flex-shrink: 0; font-size: .72rem; padding: 0 .25rem; }
.gw-gantt__col-assignee { width: 70px; flex-shrink: 0; padding: 0 .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gw-gantt__left-rows {
  overflow: hidden;
  position: relative;
}

.gw-gantt__row--left {
  display: flex;
  align-items: center;
  height: 40px;
  border-bottom: 1px solid var(--color-border);
  font-size: .82rem;
  position: relative;
}

.gw-gantt__row--left:hover { background: var(--color-bg); }
.gw-gantt__row--milestone .gw-gantt__col-task { color: var(--color-primary); font-weight: 600; }

.gw-gantt__expand { cursor: pointer; color: var(--color-text-muted); font-size: .95rem; }
.gw-gantt__leaf   { display: inline-block; width: 1em; }
.gw-gantt__task-name { display: inline; }

.gw-gantt__dep-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.gw-gantt__dep-svg path {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.gw-gantt__row-actions {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  gap: .25rem;
  background: var(--color-surface);
  padding: .25rem .5rem;
  border-left: 1px solid var(--color-border);
  z-index: 2;
}

.gw-gantt__row--left:hover .gw-gantt__row-actions { display: flex; }

/* 右パネル */
.gw-gantt__right-panel {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gw-gantt__timeline-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.gw-gantt__timeline-inner { display: flex; flex-direction: column; }

.gw-gantt__header-row {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  height: 26px;
}

.gw-gantt__header-cell {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  border-right: 1px solid var(--color-border);
  overflow: hidden;
  white-space: nowrap;
}

.gw-gantt__header-month { font-weight: 600; background: var(--color-bg); }
.gw-gantt__header-day.is-sunday { color: #ef4444; background: #fef2f2; }
.gw-gantt__header-day.is-saturday { color: #3b82f6; background: #eff6ff; }

.gw-gantt__chart-area {
  position: relative;
  flex: 1;
}

.gw-gantt__chart-inner {
  position: relative;
  min-height: 80px;
}

.gw-gantt__row-bg {
  position: absolute;
  height: 40px;
  left: 0;
}
.gw-gantt__row-bg--alt { background: rgba(0,0,0,.02); }

.gw-gantt__vgrid {
  position: absolute;
  top: 0;
  width: 1px;
  background: var(--color-border);
  opacity: .5;
}
.gw-gantt__vgrid--weekend { background: #cbd5e1; opacity: .6; }

.gw-gantt__today-line {
  position: absolute;
  top: 0;
  width: 2px;
  background: #ef4444;
  z-index: 5;
  opacity: .8;
}

.gw-gantt__bar {
  position: absolute;
  height: 28px;
  background: var(--color-primary);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-width: 8px;
  z-index: 3;
  cursor: default;
}

.gw-gantt__bar { cursor: grab; }
.gw-gantt__bar:hover { filter: brightness(1.1); }
.gw-gantt__bar.is-dragging { cursor: grabbing; opacity: .8; z-index: 10; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.gw-gantt__bar--on-cal {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0)   0px,
    rgba(255,255,255,0)   5px,
    rgba(255,255,255,0.28) 5px,
    rgba(255,255,255,0.28) 9px
  );
}

.gw-gantt__bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--color-primary-dk);
  opacity: .5;
}

.gw-gantt__bar-label {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.gw-gantt__milestone {
  position: absolute;
  z-index: 4;
  background: var(--color-warning);
  transform: rotate(45deg);
  border-radius: 2px;
  cursor: default;
}

.gw-gantt__milestone:hover { filter: brightness(1.15); }

/* ダークテーマ対応 */
[data-theme="dark"] .gw-gantt {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .gw-gantt__controls,
[data-theme="dark"] .gw-gantt__col-header,
[data-theme="dark"] .gw-gantt__timeline-header,
[data-theme="dark"] .gw-gantt__header-month { background: #1e293b; }
[data-theme="dark"] .gw-gantt__row-bg--alt  { background: rgba(255,255,255,.03); }
[data-theme="dark"] .gw-gantt__header-day.is-sunday  { background: #3f1010; }
[data-theme="dark"] .gw-gantt__header-day.is-saturday { background: #0f2040; }
[data-theme="dark"] .gw-gantt__row--left:hover { background: #1e293b; }
[data-theme="dark"] .gw-gantt__row-actions { background: var(--color-surface); }
[data-theme="dark"] .gw-gantt__dep-svg path { stroke: #475569; }

/* ============================================================
   タイムカード
============================================================ */
.gw-tc-month { font-weight: 700; font-size: 1rem; padding: 0 .25rem; }

.gw-tc-wrap  { overflow-x: auto; }

.gw-tc-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
  min-width: 600px; table-layout: fixed;
}
.gw-tc-table th, .gw-tc-table td {
  padding: .4rem .35rem; border-bottom: 1px solid var(--color-border);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gw-tc-table th {
  background: var(--color-bg); font-weight: 600; font-size: .75rem;
  color: var(--color-text-muted); position: sticky; top: 0; z-index: 1;
}

/* 列幅（修正理由以外はギリギリ） */
.gw-tc-th--date   { width: 80px;  }
.gw-tc-th--wt     { width: 92px; text-align: left; }
.gw-tc-th--time   { width: 50px;  }
.gw-tc-th--dur    { width: 54px;  }
.gw-tc-th--reason { /* 残り全幅 */ text-align: left; }

.gw-tc-td--date   { text-align: left; padding-left: .45rem; }
.gw-tc-td--wt     { text-align: left; }
.gw-tc-td--time   { font-variant-numeric: tabular-nums; font-size: .8rem; }
.gw-tc-td--dur    { font-variant-numeric: tabular-nums; font-size: .8rem; }
.gw-tc-table td.gw-tc-td--reason { text-align: left; max-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 日付セル */
.gw-tc-day { font-weight: 600; font-size: .82rem; }
.gw-tc-dow { font-size: .72rem; margin-left: 1px; }
.gw-tc-dow--sat  { color: #3b82f6; }
.gw-tc-dow--sun  { color: #ef4444; }
.gw-tc-dow--wday { color: var(--color-text-muted); }

/* 行の色 */
.gw-tc-row--sat td   { background: rgba(59,130,246,.04); }
.gw-tc-row--sun td   { background: rgba(239,68,68,.04); }
.gw-tc-row--today td { background: #fffbeb; }
.gw-tc-row--today .gw-tc-day { color: #d97706; font-weight: 700; }
.gw-tc-row--past:hover td { background: #f0f4ff; cursor: pointer; }

/* 打刻済み時刻 */
.gw-tc-punched { font-weight: 700; font-size: .82rem; }

/* 修正モーダル：出退勤セッション行 */
.gw-tc-session-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.gw-tc-session-row .gw-form__input { width: auto; flex: 1; }
.gw-tc-session-sep { color: var(--color-text-muted); font-size: .85rem; }

/* 計算値の強調 */
.gw-tc-ot  { color: var(--color-warning); font-weight: 700; }
.gw-tc-hol { color: var(--color-danger);  font-weight: 700; }

/* 勤務形態 */
.gw-tc-wt-sel {
  font-size: .75rem; padding: .15rem .2rem; height: auto;
  border: 1px solid var(--color-border); border-radius: 4px;
  background: var(--color-surface); color: var(--color-text);
  width: 100%; max-width: 86px;
}
.gw-tc-wt-nm { font-size: .76rem; color: var(--color-text-muted); }

/* 打刻ボタン */
.gw-tc-pbtn {
  display: inline-block; border: none; border-radius: 4px; cursor: pointer;
  font-size: .72rem; font-family: inherit; font-weight: 600;
  padding: 2px 5px; line-height: 1.5; white-space: nowrap;
  transition: opacity .15s;
}
.gw-tc-pbtn:hover:not(:disabled) { opacity: .85; }
.gw-tc-pbtn:disabled { opacity: .35; cursor: not-allowed; }
.gw-tc-pbtn--in  { background: var(--color-primary); color: #fff; }
.gw-tc-pbtn--out { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.gw-tc-pbtn--go  { background: var(--color-warning); color: #fff; }
.gw-tc-pbtn--ret { background: #e0e7ff; color: var(--color-primary); }

/* 修正理由 */
.gw-tc-reason-txt   { font-size: .76rem; color: var(--color-text-muted); }
.gw-tc-reason-empty { color: var(--color-border); }

/* ===== 管理者タイムカード集計 ===== */
.gw-atc-table { table-layout: auto; }
.gw-atc-th--num { text-align: right; white-space: nowrap; }
.gw-atc-td--num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gw-atc-td--ot  { color: var(--color-warning); font-weight: 700; }
.gw-atc-td--hol { color: var(--color-danger);  font-weight: 700; }
.gw-atc-td--link { text-align: right; white-space: nowrap; }
.gw-atc-tr--total td { border-top: 2px solid var(--color-border); background: var(--color-bg); }

/* ダークテーマ */
[data-theme="dark"] .gw-tc-row--sat td    { background: rgba(59,130,246,.07); }
[data-theme="dark"] .gw-tc-row--sun td    { background: rgba(239,68,68,.07); }
[data-theme="dark"] .gw-tc-row--today td  { background: rgba(245,158,11,.08); }
[data-theme="dark"] .gw-tc-row--past:hover td { background: #1e2a3a; }
[data-theme="dark"] .gw-tc-wt-sel { background: var(--color-surface); color: var(--color-text); }

/* ============================================================
   SP最適化：ダッシュボード全般
============================================================ */
@media (max-width: 768px) {
  /* ページヘッダー：タイトルと日付を折り返し */
  .gw-page-header {
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .85rem;
  }
  .gw-page-title { font-size: 1.1rem; }
  .gw-page-date  { font-size: .78rem; }

  /* カード全般のパディングを縮小 */
  .gw-card__header { padding: .65rem .9rem; gap: .4rem; }
  .gw-card__body   { padding: .75rem .9rem; }

  /* スコープタブ自体のサイズ調整 */
  .gw-scope-tab { padding: .22rem .6rem; font-size: .76rem; }

  /* タイムカード打刻パネル */
  .gw-dash-tc-body    { flex-direction: column; gap: .75rem; }
  .gw-dash-tc-wt      { width: 100%; }
  .gw-dash-tc-wt .gw-tc-wt-sel { max-width: none !important; flex: 1; }
  .gw-dash-tc-btns    { width: 100%; justify-content: space-around; gap: .4rem; }
  .gw-dash-tc-item    { flex: 1; min-width: 0; }
  .gw-dash-tc-btn     { font-size: .78rem; padding: .28rem .5rem; white-space: nowrap; }
}

/* 週間スケジュール：スコープタブバー（カードヘッダーとボディの間） */
.gw-dash-week-tabs-bar {
  padding: .4rem 1.25rem .5rem;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gw-dash-week-tabs-bar::-webkit-scrollbar { display: none; }
.gw-dash-week-tabs-bar .gw-scope-tabs {
  margin: 0;
  flex-wrap: nowrap;
  gap: .25rem;
  display: flex;
}
@media (max-width: 768px) {
  .gw-dash-week-tabs-bar { padding: .35rem .9rem .4rem; }
}
[data-theme="dark"] .gw-dash-week-tabs-bar { border-bottom-color: var(--color-border); }

/* FullCalendar リストビュー（SP週間カレンダー）スタイル */
.fc-list-day-cushion {
  background: var(--color-bg) !important;
  padding: .4rem .85rem !important;
  font-size: .84rem;
}
.fc-list-day-side-text,
.fc-list-day-text { font-weight: 700; }
.fc-list-event:hover td { background: #f0f4ff !important; cursor: pointer; }
.fc-list-event td { font-size: .88rem; }
.fc-list-table { width: 100%; }

[data-theme="dark"] .fc-list-day-cushion { background: #2d3748 !important; color: var(--color-text); }
[data-theme="dark"] .fc-list-event:hover td { background: #1e293b !important; }
/* fc-list-event td に background を指定しない（個人別カラーが <tr> 背景で表示される場合に上書きしないため） */
[data-theme="dark"] .fc-list-event-time { color: var(--color-text-muted); }
[data-theme="dark"] .fc-list-event-title { color: var(--color-text); }
[data-theme="dark"] .fc-list-event td,
[data-theme="dark"] .fc-list-day th { border-color: #374151 !important; }
[data-theme="dark"] .fc-list-empty { background: var(--color-surface); color: var(--color-text-muted); }
[data-theme="dark"] .fc-list { background: var(--color-surface); }
[data-theme="dark"] .fc-list-table { background: var(--color-surface); }

/* ------------------------------------------------------------
   FullCalendar 土日カラム：CSS で制御（JS インラインスタイル不使用）
   !important を除去し個人別イベントカラーを保護
------------------------------------------------------------ */
/* timeGridWeek：土日のカラム背景（!important なしで FullCalendar 内部スタイルを尊重） */
.fc .fc-timegrid-col.fc-day-sun { background-color: rgba(239,68,68,0.04); }
.fc .fc-timegrid-col.fc-day-sat { background-color: rgba(59,130,246,0.04); }
[data-theme="dark"] .fc .fc-timegrid-col.fc-day-sun { background-color: rgba(239,68,68,0.09); }
[data-theme="dark"] .fc .fc-timegrid-col.fc-day-sat { background-color: rgba(59,130,246,0.09); }

/* PC 列ヘッダー（timeGridWeek / daygrid）土日の文字色
   <a class="fc-col-header-cell-cushion"> がテキストを包むため、そこを直接ターゲット */
.fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion,
.fc-col-header-cell.fc-day-sun .fc-dh-wday,
.fc-col-header-cell.fc-day-sun .fc-dh-mdate { color: #ef4444 !important; }
.fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion,
.fc-col-header-cell.fc-day-sat .fc-dh-wday,
.fc-col-header-cell.fc-day-sat .fc-dh-mdate { color: #3b82f6 !important; }
.fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-col-header-cell-cushion,
.fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-dh-wday,
.fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-dh-mdate { color: #6b7280 !important; }
[data-theme="dark"] .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion,
[data-theme="dark"] .fc-col-header-cell.fc-day-sun .fc-dh-wday,
[data-theme="dark"] .fc-col-header-cell.fc-day-sun .fc-dh-mdate { color: #f87171 !important; }
[data-theme="dark"] .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion,
[data-theme="dark"] .fc-col-header-cell.fc-day-sat .fc-dh-wday,
[data-theme="dark"] .fc-col-header-cell.fc-day-sat .fc-dh-mdate { color: #60a5fa !important; }
[data-theme="dark"] .fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-col-header-cell-cushion,
[data-theme="dark"] .fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-dh-wday,
[data-theme="dark"] .fc-col-header-cell:not(.fc-day-sun):not(.fc-day-sat) .fc-dh-mdate { color: #9ca3af !important; }
[data-theme="dark"] .fc-daygrid-day.fc-day-sun .fc-daygrid-day-number { color: #f87171; }
[data-theme="dark"] .fc-daygrid-day.fc-day-sat .fc-daygrid-day-number { color: #60a5fa; }
[data-theme="dark"] .fc-daygrid-day:not(.fc-day-sun):not(.fc-day-sat) .fc-daygrid-day-number { color: #9ca3af; }

/* SP listWeek：日付見出し色（平日ベース → 土日で上書き） */
.fc-list-day .fc-list-day-text,
.fc-list-day .fc-list-day-side-text { color: #4b5563; }
[data-theme="dark"] .fc-list-day .fc-list-day-text,
[data-theme="dark"] .fc-list-day .fc-list-day-side-text { color: #9ca3af; }
.fc-list-day.fc-day-sun .fc-list-day-text,
.fc-list-day.fc-day-sun .fc-list-day-side-text { color: #ef4444; }
.fc-list-day.fc-day-sat .fc-list-day-text,
.fc-list-day.fc-day-sat .fc-list-day-side-text { color: #3b82f6; }
[data-theme="dark"] .fc-list-day.fc-day-sun .fc-list-day-text,
[data-theme="dark"] .fc-list-day.fc-day-sun .fc-list-day-side-text { color: #f87171; }
[data-theme="dark"] .fc-list-day.fc-day-sat .fc-list-day-text,
[data-theme="dark"] .fc-list-day.fc-day-sat .fc-list-day-side-text { color: #60a5fa; }

/* 打刻ボタン：復帰ボタンのダーク対応 */
[data-theme="dark"] .gw-tc-pbtn--ret { background: #1e3a5f; color: var(--color-primary); }

/* ------------------------------------------------------------
   カレンダー イベント詳細モーダル
------------------------------------------------------------ */
.gw-ev-detail { display: flex; flex-direction: column; }
.gw-ev-row { padding: .55rem 0; border-bottom: 1px solid var(--color-border); }
.gw-ev-row:last-child { border-bottom: none; }
.gw-ev-row--2col { display: flex; gap: 1.5rem; }
.gw-ev-row--2col .gw-ev-item { flex: 1; min-width: 0; }
.gw-ev-item { display: flex; flex-direction: column; gap: .1rem; }
.gw-ev-label { font-size: .72rem; font-weight: 600; color: var(--color-text-muted); }
.gw-ev-value { font-size: .9rem; color: var(--color-text); word-break: break-word; }
.gw-ev-attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.gw-ev-thumb { display: block; width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--color-border); transition: opacity .15s; }
.gw-ev-thumb:hover { opacity: .82; }
.gw-ev-file { display: inline-flex; align-items: center; font-size: .8rem; padding: .25rem .6rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); text-decoration: none; }
.gw-ev-file:hover { background: var(--color-surface); }

/* ------------------------------------------------------------
   カレンダー SP 対応
   - ヘッダーツールバーを2行化（月・週・日ボタンを下段へ）
   - 週表示のカラムヘッダーを縦積み（曜日 + 日付）
------------------------------------------------------------ */
/* dayHeaderContent で返したスパン */
.fc-dh-wday, .fc-dh-mdate { display: block; line-height: 1.3; }
.fc-dh-wday  { font-size: .82rem; font-weight: 700; }
.fc-dh-mdate { font-size: .75rem; font-weight: 400; }

/* SP：ヘッダーツールバー2行化 */
@media (max-width: 640px) {
  .gw-calendar-wrap .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    row-gap: .35rem;
  }
  /* 右チャンク（月・週・日）を2行目・全幅・中央揃えへ */
  .gw-calendar-wrap .fc-header-toolbar .fc-toolbar-chunk:last-child {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  /* タイトル行を縮小フォントで収める */
  .gw-calendar-wrap .fc-toolbar-title { font-size: 1rem; }
  /* all-day → 全日 の幅を確保（縦軸ラベル列） */
  .gw-calendar-wrap .fc-timegrid-axis { min-width: 2.5rem; font-size: .75rem; }
}

/* ------------------------------------------------------------
   FullCalendar イベントホバーツールチップ
------------------------------------------------------------ */
.fc-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  max-width: 280px;
  pointer-events: none;
  overflow: hidden;
}
.fc-tip-title {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem;
  font-size: .875rem; font-weight: 700;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  word-break: break-all;
}
.fc-tip-dot {
  flex-shrink: 0;
  width: .6rem; height: .6rem;
  border-radius: 50%;
  display: inline-block;
}
.fc-tip-body {
  padding: .4rem .75rem .5rem;
  font-size: .8rem;
  line-height: 1.6;
  color: var(--color-text);
}
.fc-tip-time {
  color: var(--color-text-muted);
  font-size: .78rem;
}
.fc-tip-desc {
  color: var(--color-text-muted);
  white-space: pre-wrap;
}
