/* ============================================================
   管理者画面 CSS
   ナナコジャパン合同会社 業務契約管理システム
   ============================================================ */

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

/* ============================================================
   CSS変数
   ============================================================ */
:root {
  --color-primary:    #4f46e5;
  --color-primary-d:  #3730a3;
  --color-primary-l:  #e0e7ff;
  --color-secondary:  #0ea5e9;
  --color-success:    #10b981;
  --color-warning:    #f59e0b;
  --color-danger:     #ef4444;
  --color-info:       #3b82f6;

  --color-bg:         #f1f5f9;
  --color-surface:    #ffffff;
  --color-border:     #e2e8f0;
  --color-text:       #1e293b;
  --color-text-muted: #64748b;
  --color-sidebar-bg: #1e1b4b;
  --color-sidebar-hover: #312e81;
  --color-sidebar-active: #4f46e5;

  --sidebar-width:    240px;
  --topbar-height:    56px;
  --radius:           8px;
  --radius-lg:        12px;
  --shadow:           0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:        0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:        0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition:       0.2s ease;
}

/* ============================================================
   リセット・ベース
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Noto Sans JP', 'Inter', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ============================================================
   レイアウト
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   サイドバー
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar-bg);
  color: #c7d2fe;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .25rem;
}

.logo-icon { font-size: 1.3rem; }
.logo-text { letter-spacing: -.02em; }

.sidebar-company {
  font-size: .75rem;
  color: #818cf8;
  padding-left: 1.8rem;
}

.nav-menu { padding: .75rem 0; flex: 1; }

.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #6366f1;
  text-transform: uppercase;
  padding: .75rem 1rem .25rem;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  color: #c7d2fe;
  font-size: .875rem;
  border-radius: 6px;
  margin: .1rem .5rem;
  transition: background var(--transition), color var(--transition);
}

.nav-menu li a:hover {
  background: var(--color-sidebar-active);
  color: #fff;
  text-decoration: none;
}

.nav-menu li.active a {
  background: var(--color-sidebar-active);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

/* アクティブ項目の左縦線（::beforeでレイアウトシフトなし） */
.nav-menu li.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0 3px 3px 0;
  z-index: 1;
}

.nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: #a5b4fc;
  margin-bottom: .5rem;
}

.logout-btn {
  display: block;
  text-align: center;
  padding: .4rem;
  font-size: .8rem;
  color: #a5b4fc;
  border: 1px solid rgba(165,180,252,.3);
  border-radius: 6px;
  transition: background var(--transition);
}

.logout-btn:hover { background: rgba(165,180,252,.1); text-decoration: none; }

/* ============================================================
   メインコンテンツ
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text-muted);
  display: none;
  padding: .25rem .5rem;
  border-radius: 4px;
}

.sidebar-toggle:hover { background: var(--color-bg); }

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.content-body {
  padding: 1.5rem;
  flex: 1;
}

/* ============================================================
   カード
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #fafafa;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.card-toolbar {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}

.card-body { padding: 1.25rem; }

/* ============================================================
   ダッシュボード
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stats-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '→';
  position: absolute;
  right: 1rem;
  bottom: .75rem;
  font-size: .8rem;
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #a5b4fc;
}

.stat-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.stat-icon { font-size: 2rem; }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .2rem;
}

.stat-blue  .stat-value { color: var(--color-info); }
.stat-orange .stat-value { color: var(--color-warning); }
.stat-yellow .stat-value { color: #d97706; }
.stat-green  .stat-value { color: var(--color-success); }

/* フロー進捗 */
.flow-summary-item { padding: .75rem 0; border-bottom: 1px solid var(--color-border); }
.flow-summary-item:last-child { border-bottom: none; }
.flow-summary-header { margin-bottom: .4rem; }
.progress-bar-wrap {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .3rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 3px;
  transition: width .5s ease;
}
.flow-summary-meta { font-size: .75rem; color: var(--color-text-muted); }

/* クイックリンク */
.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--color-text);
  transition: all var(--transition);
}

.quick-link:hover {
  background: var(--color-primary-l);
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

/* ============================================================
   テーブル
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  text-align: left;
  padding: .6rem .75rem;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: .75rem .75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table-hover tbody tr:hover { background: #f8fafc; }

.table .actions { white-space: nowrap; }

.total-row td {
  background: #f0f9ff;
  font-weight: 700;
}

.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: .8rem; }

/* ============================================================
   バッジ
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-teal   { background: #ccfbf1; color: #065f46; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-d); border-color: var(--color-primary-d); color: #fff; }

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}
.btn-secondary:hover { opacity: .9; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-outline:hover { background: var(--color-bg); }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover { opacity: .85; color: #fff; }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs { padding: .2rem .6rem; font-size: .75rem; }
.btn-block { width: 100%; }

/* ============================================================
   フォーム
   ============================================================ */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .35rem;
}

.required { color: var(--color-danger); }

.form-control {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-control-sm { padding: .35rem .6rem; font-size: .8rem; }

select.form-control { appearance: none; cursor: pointer; }

textarea.form-control { resize: vertical; }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row.align-center { align-items: flex-end; }

.col-4  { flex: 4; min-width: 120px; }
.col-6  { flex: 6; min-width: 120px; }
.col-8  { flex: 8; min-width: 180px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.input-prefix-group,
.input-suffix-group {
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  padding: .55rem .6rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: .875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.input-prefix { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.input-suffix { border-left: none; border-radius: 0 var(--radius) var(--radius) 0; }

.input-prefix-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; }
.input-suffix-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }

.input-copy-group { display: flex; gap: .5rem; }
.input-copy-group .form-control { flex: 1; }

.checkbox-group,
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  font-size: .875rem;
}

.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

.password-wrapper { position: relative; }
.password-toggle {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.search-form { display: flex; gap: .5rem; }
.search-input { min-width: 240px; }

.client-filter-form { margin-bottom: 1rem; }

/* ============================================================
   アラート
   ============================================================ */
.alert {
  position: relative;
  padding: .875rem 2.5rem .875rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}

.alert-success  { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-danger   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info     { background: #dbeafe; border: 1px solid #93c5fd; color: #1e40af; }
.alert-warning  { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }

.alert ul { padding-left: 1.2em; margin: 0; }
.alert .alert-close {
  position: absolute;
  right: .75rem; top: .75rem;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: inherit; opacity: .7;
}

/* ============================================================
   詳細リスト
   ============================================================ */
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: .5rem 1rem; }
.detail-list dt { font-weight: 600; font-size: .8rem; color: var(--color-text-muted); padding-top: .1rem; }
.detail-list dd { color: var(--color-text); }

/* ============================================================
   フロー（管理画面）
   ============================================================ */
.flow-steps { display: flex; flex-direction: column; gap: .5rem; }

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color var(--transition);
}

.flow-step-completed { border-color: var(--color-success); background: #f0fdf4; }
.flow-step-in_progress { border-color: var(--color-primary); background: var(--color-primary-l); }

.flow-step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}

.flow-step-completed .flow-step-number { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.flow-step-in_progress .flow-step-number { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.flow-step-body { flex: 1; }
.flow-step-title { font-weight: 600; margin-bottom: .25rem; }
.flow-step-plan { font-size: .8rem; }

/* ============================================================
   ステータスフィルタータブ
   ============================================================ */
.status-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.filter-tab {
  padding: .3rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   2カラムレイアウト
   ============================================================ */
.page-two-col {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.col-main { flex: 2; }
.col-side { flex: 1; min-width: 280px; }

/* ============================================================
   情報ボックス
   ============================================================ */
.info-box {
  padding: .6rem .75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .5rem;
}

/* 工数単価グリッド */
.rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-top: .5rem;
}

.rate-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem;
}

.rate-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .2rem;
}

.rate-desc {
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-bottom: .5rem;
  line-height: 1.4;
}

/* メニュー表示設定グリッド */
.menu-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem;
  margin-top: .5rem;
}
.menu-vis-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .82rem;
}
.menu-vis-label:hover { border-color: var(--color-primary); }
.menu-vis-label.is-visible { background: #f0fdf4; border-color: #a7f3d0; }
.menu-vis-label.is-hidden  { background: #fef2f2; border-color: #fecaca; opacity: .7; }
.menu-vis-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--color-success);
  flex-shrink: 0;
}
.menu-vis-name { flex: 1; font-weight: 600; }
.menu-vis-hours {
  font-size: .7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: .1rem .4rem;
  border-radius: 4px;
}

/* 削除チェック */
.delete-check {
  display: flex;
  align-items: center;
  gap: .25rem;
  cursor: pointer;
  font-size: .75rem;
}
.delete-check input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--color-danger); }
.text-danger { color: var(--color-danger); font-weight: 700; }
.section-label {
  font-size: .875rem;
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--color-primary);
}

.sub-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }

/* ============================================================
   ログイン画面
   ============================================================ */
.login-page {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon { font-size: 3rem; display: block; margin-bottom: .5rem; }

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .25rem;
}

.login-subtitle {
  font-size: .85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   テーブルラッパー（横スクロール用）
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.table-wrap .table { min-width: 580px; }

/* ============================================================
   レスポンシブ ― 4 段階ブレークポイント
   ============================================================ */

/* ── 1280px 以下: サイドバー幅縮小 ── */
@media (max-width: 1280px) {
  :root { --sidebar-width: 210px; }
}

/* ── 1024px 以下: グリッド1列化 ── */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-row      { grid-template-columns: repeat(2, 1fr); }
  .quick-links    { grid-template-columns: 1fr 1fr; }
  .page-two-col   { flex-direction: column; }
  .col-main, .col-side { width: 100%; flex: none; min-width: 0; }
  .rate-grid      { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px 以下: モバイルレイアウト ── */
@media (max-width: 768px) {
  html { font-size: 13px; }

  /* サイドバー */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .sidebar.open   { transform: translateX(0); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }

  /* サイドバーオーバーレイ */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
  }
  .sidebar-overlay.show { display: block; }

  /* メインコンテンツ */
  .main-content { margin-left: 0; }
  .content-body { padding: 1rem .75rem; }

  /* ==== テーブル横スクロール（全ページ共通） ====
     .cardのoverflow:hiddenを解除し、.card-bodyをスクロール可能にする */
  .card          { overflow: visible; }
  .card-body     { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 全テーブルにmin-widthを設定してスクロールを誘発 */
  .table {
    min-width: 560px;
    font-size: .8rem;
  }
  .table th     { padding: .5rem .5rem; font-size: .7rem; }
  .table td     { padding: .5rem .5rem; }
  .table-wrap .table { min-width: 500px; }

  /* 一方、padding:0のcard-bodyは内包にインラインがある場合が多いので追加 */
  .card-body.p-0 { overflow-x: auto; }

  /* ==== グリッド ==== */
  .stats-row      { grid-template-columns: 1fr 1fr; }
  .quick-links    { grid-template-columns: 1fr; }
  .dashboard-grid { gap: 1rem; }
  .rate-grid      { grid-template-columns: repeat(2, 1fr); }
  .menu-visibility-grid { grid-template-columns: 1fr 1fr; }

  /* ==== 2カラムレイアウト ==== */
  .page-two-col   { flex-direction: column; }
  .col-main, .col-side { width: 100% !important; flex: none; min-width: 0 !important; }
  .admin-two-col  { flex-direction: column; }

  /* ==== ページヘッダー（インラインflexたのも折り返し） ==== */
  .page-header    { flex-direction: column; align-items: flex-start; gap: .5rem; }
  /* card-header内のダイレクトflex要素も折り返す */
  .card-header    { flex-wrap: wrap; gap: .5rem; }
  .card-header > div[style*="flex"],
  .card-header > div[style*="display"] { flex-wrap: wrap; }

  /* ==== フィルター・検索フォーム ==== */
  .search-form    { flex-wrap: wrap; gap: .4rem; }
  .search-input   { min-width: 0 !important; width: 100%; flex: 1 1 100%; }
  .filter-form    { flex-wrap: wrap; gap: .4rem; }
  .client-filter-form { flex-wrap: wrap; gap: .4rem; }
  .client-filter-form select,
  .client-filter-form input { flex: 1 1 140px; min-width: 100px; }
  .inline-form    { flex-wrap: wrap; gap: .4rem; }

  /* 検索インプットのmin-widthを上書き */
  input[type="text"].form-control,
  input[type="search"].form-control { min-width: 0 !important; }

  /* ==== ステータスフィルタータブ ==== */
  /* タブが多い場合は横スクロール化 */
  .status-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .25rem;
    gap: .3rem;
  }
  .filter-tab { white-space: nowrap; flex-shrink: 0; }

  /* ==== タブナビ ==== */
  .tab-nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* ==== カード ==== */
  .card           { margin-bottom: 1rem; }

  /* ==== stat-card ==== */
  .stat-card      { padding: 1rem; gap: .75rem; }
  .stat-value     { font-size: 1.6rem; }
  .stat-icon      { font-size: 1.6rem; }

  /* ==== モーダル ==== */
  /* 固定ポジションモーダル（インラインスタイルきe定義のモーダル内部） */
  .modal-dialog   { margin: .75rem; max-width: calc(100% - 1.5rem); }
  .modal-body     { padding: 1rem; }
  /* 内容エリアのmax-width制限解除（全幅表示） */
  [id$="-modal"] > div,
  [id$="Modal"] > div {
    max-width: calc(100vw - 1.5rem) !important;
    width: calc(100vw - 1.5rem) !important;
    margin: .75rem auto !important;
    padding: 1.25rem !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  /* モーダル内のフォーム行 */
  [id$="-modal"] .form-row,
  [id$="Modal"] .form-row { flex-direction: column; }
  [id$="-modal"] .form-row [class^="col-"],
  [id$="Modal"] .form-row [class^="col-"] { width: 100% !important; min-width: 0; }

  /* ==== アクションボタンエリア ==== */
  .form-actions   { flex-wrap: wrap; gap: .5rem; }

  /* ==== detail-list ==== */
  .detail-list    { grid-template-columns: 90px 1fr; }

  /* ==== 浮上一括操作バー ==== */
  #bulk-bar, [id$="-bar"][style*="fixed"] { flex-wrap: wrap; gap: .4rem; font-size: .78rem; padding: .5rem .75rem; }
}

/* ── 480px 以下: 小型スマホ最適化 ── */
@media (max-width: 480px) {
  html { font-size: 12.5px; }

  .content-body   { padding: .75rem .5rem; }
  .stats-row      { grid-template-columns: 1fr; }
  .stat-card      { padding: .75rem; }
  .stat-value     { font-size: 1.4rem; }

  .btn            { font-size: .78rem; padding: .4rem .75rem; }
  .btn-sm         { font-size: .72rem; padding: .28rem .5rem; }
  .btn-xs         { font-size: .68rem; padding: .2rem .45rem; }

  .table          { min-width: 480px; }
  .table th,
  .table td       { font-size: .72rem; padding: .4rem .4rem; }

  .card-body      { padding: .65rem; }
  .card-header    { padding: .65rem .75rem; }

  .badge          { font-size: .65rem; padding: .15rem .4rem; }

  .topbar         { padding: 0 .75rem; }
  .page-title     { font-size: .95rem; }

  .form-control   { font-size: .82rem; padding: .45rem .6rem; }

  /* 詳細リスト：縦積み */
  .detail-list    { grid-template-columns: 1fr; }
  .detail-list dt { padding-top: .5rem; border-top: 1px solid var(--color-border); margin-top: .25rem; }

  /* レートグリッド */
  .rate-grid      { grid-template-columns: 1fr; }

  /* メニュー表示設定 */
  .menu-visibility-grid { grid-template-columns: 1fr; }

  /* フォームアクション */
  .form-actions   { flex-direction: column; align-items: stretch; }
  .form-actions .btn { text-align: center; justify-content: center; }
}


/* キャンセル行のグレーアウト・打ち消し線 */
.tr-cancelled {
  opacity: 0.6;
  background-color: #f1f5f9 !important;
}
.tr-cancelled td {
  text-decoration: line-through;
  color: var(--color-text-muted) !important;
}
.tr-cancelled:hover,
.tr-cancelled:hover td {
  background-color: #f1f5f9 !important;
}
.tr-cancelled td a {
  color: var(--color-text-muted) !important;
}

/* ============================================================
   レスポンシブ＆画面横スクロール崩れ完全防止補強
   ============================================================ */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.app-layout, .main-content, .content-body, .dashboard-grid {
  max-width: 100%;
  box-sizing: border-box;
}

/* 長い英数字・URL・日本語テキストの突抜け防止 */
.table td, .table th, .card, .action-title, .comment-text, .detail-list dd {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* テーブル親要素の自動横スクロール化 */
.table-responsive, .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* 768px 以下の画面でカード・テーブル幅を100%に適合 */
@media (max-width: 768px) {
  .app-layout { overflow-x: hidden; }
  .content-body { padding: 12px 10px; max-width: 100vw; overflow-x: hidden; }
  .card-header { padding: 10px 12px; }
  .card-body { padding: 10px 12px; }
}


/* ============================================================
 * メニューガイド & 操作説明 AI CHAT ウィジェット
 * ============================================================ */

/* サイドバーの各メニューアイテムの配置調整 */
.nav-menu li {
  position: relative;
}
.nav-menu li a {
  display: flex !important;
  align-items: center;
  padding-right: 36px !important;
  position: relative;
}

/* インフォメーション ( i ) ボタン */
.nav-info-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 3;
}
.nav-info-btn:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
  transform: translateY(-50%) scale(1.1);
}
.nav-menu li.active .nav-info-btn {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.85);
}

/* トップバーのガイドボタン */
.topbar-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 12px;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-guide-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37,99,235,0.15);
}

/* メニューガイド共通モーダル / ポップオーバー */
.admin-guide-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: guideFadeIn 0.2s ease;
}
.admin-guide-modal-overlay.show {
  display: flex;
}
@keyframes guideFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.admin-guide-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  animation: guideSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes guideSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
}
.admin-guide-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.admin-guide-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.admin-guide-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.admin-guide-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #334155;
}
.admin-guide-summary-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-weight: 700;
  color: #166534;
}
.admin-guide-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-guide-list {
  margin: 0 0 16px 20px;
  padding: 0;
  color: #475569;
}
.admin-guide-list li {
  margin-bottom: 6px;
}
.admin-guide-steps-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #334155;
}
.admin-guide-tips-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  color: #1e40af;
  font-size: 0.85rem;
}

.admin-guide-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-guide-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s;
  text-decoration: none;
}
.admin-guide-ai-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* ============================================================
 * 右下常駐 操作サポート AI チャット ウィジェット
 * ============================================================ */

/* フローティング起動ボタン */
.admin-ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}
.admin-ai-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 32px rgba(37, 99, 235, 0.55);
}
.admin-ai-fab-icon {
  font-size: 1.3rem;
  animation: fabPulse 2.5s infinite;
}
@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15) rotate(-5deg); }
}
.admin-ai-fab-label {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.admin-ai-fab-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}

/* チャットウィンドウ本体 */
.admin-ai-widget {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 9995;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: widgetSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-ai-widget.open {
  display: flex;
}
@keyframes widgetSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-ai-widget-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-ai-widget-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
.admin-ai-name {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
}
.admin-ai-status {
  font-size: 0.72rem;
  color: #86efac;
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.admin-ai-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}
.admin-ai-close:hover {
  color: #ffffff;
}

/* 現在開いている画面バー */
.admin-ai-context-bar {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 16px;
  font-size: 0.78rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-ai-context-badge {
  background: #e2e8f0;
  color: #0f172a;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* チャットメッセージエリア */
.admin-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}
.admin-ai-msg {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 95%;
  animation: msgFadeIn 0.2s ease;
  align-items: flex-start;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 85%;
}
.admin-ai-msg.bot {
  align-self: flex-start;
  width: 100%;
}
.admin-ai-bubble {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.admin-ai-msg.bot .admin-ai-bubble {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 4px;
}
.admin-ai-msg.user .admin-ai-bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-top-right-radius: 4px;
}
.admin-ai-bubble a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: underline;
}
.admin-ai-bubble ol {
  margin: 10px 0 10px 0 !important;
  padding-left: 24px !important;
  list-style-type: decimal !important;
  list-style-position: outside !important;
}
.admin-ai-bubble ul {
  margin: 10px 0 10px 0 !important;
  padding-left: 20px !important;
  list-style-type: disc !important;
  list-style-position: outside !important;
}
.admin-ai-bubble li {
  margin-bottom: 8px !important;
  line-height: 1.65 !important;
  padding-left: 4px !important;
}
.admin-ai-bubble p {
  margin: 6px 0;
}
.admin-ai-bubble b, .admin-ai-bubble strong {
  font-weight: 800;
  color: #0f172a;
}

/* クイック質問チップ */
.admin-ai-chips-wrap {
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.admin-ai-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.admin-ai-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

/* 入力フォーム */
.admin-ai-input-form {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-ai-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #f8fafc;
}
.admin-ai-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.admin-ai-send-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.admin-ai-send-btn:hover {
  transform: scale(1.08);
}
.admin-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* タイピング中インジケータ */
.admin-ai-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-items: center;
}
.admin-ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.admin-ai-dot:nth-child(1) { animation-delay: -0.32s; }
.admin-ai-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

/* モバイル・タブレット対応（768px以下: 操作サポートAIをコンパクトなアイコンFABへ変更） */
@media (max-width: 768px) {
  .admin-ai-fab {
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
  }
  .admin-ai-fab-label {
    display: none !important;
  }
  .admin-ai-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #ffffff;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
  }
  .admin-ai-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
  }
  .admin-ai-fab-icon img {
    width: 30px !important;
    height: 30px !important;
  }
  .admin-ai-widget {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .admin-guide-modal {
    max-height: 85vh;
  }
}

/* ============================================================
   SALUTO 2026 UI REFRESH (Scoped under body.ui-refresh)
   ============================================================ */
:root {
  --ur-primary: #4f46e5;
  --ur-primary-hover: #4338ca;
  --ur-primary-light: #eef2ff;
  --ur-gradient-primary: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  --ur-sidebar-bg: #181935;
  --ur-sidebar-text: #94a3b8;
  --ur-sidebar-hover: rgba(255, 255, 255, 0.08);
  --ur-sidebar-active: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  --ur-bg: #f8fafc;
  --ur-card-bg: #ffffff;
  --ur-border: #e2e8f0;
  --ur-border-light: #f1f5f9;
  --ur-text-main: #0f172a;
  --ur-text-muted: #64748b;
  --ur-text-sub: #94a3b8;
  --ur-radius-sm: 8px;
  --ur-radius-md: 12px;
  --ur-radius-lg: 16px;
  --ur-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  --ur-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.ui-refresh {
  background-color: var(--ur-bg);
  color: var(--ur-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── サイドバーのダークテーマ（画像01準拠） ── */
body.ui-refresh .sidebar {
  background: var(--ur-sidebar-bg);
  border-right: none;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
body.ui-refresh .sidebar-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem 1.25rem;
}
body.ui-refresh .sidebar-logo .logo-icon {
  background: var(--ur-gradient-primary);
  color: #fff;
  border-radius: 8px;
  padding: 4px;
}
body.ui-refresh .sidebar-logo .logo-text {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .02em;
}
body.ui-refresh .sidebar-company {
  color: #818cf8;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
}
body.ui-refresh .nav-section-label {
  color: #6366f1;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 1.25rem 0.35rem;
  opacity: 0.85;
}
body.ui-refresh .nav-menu > li > a {
  color: var(--ur-sidebar-text);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.6rem 1.25rem;
  margin: 2px 8px;
  border-radius: var(--ur-radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
body.ui-refresh .nav-menu > li > a:hover {
  background: var(--ur-sidebar-hover);
  color: #f8fafc;
}
body.ui-refresh .nav-menu > li.active > a {
  background: var(--ur-sidebar-active);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  font-weight: 700;
}
body.ui-refresh .nav-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}
body.ui-refresh .nav-info-btn {
  opacity: 0.3;
  filter: grayscale(1);
  transition: opacity 0.15s;
}
body.ui-refresh .nav-info-btn:hover {
  opacity: 0.9;
  filter: none;
}

/* ── メインコンテンツエリア ── */
body.ui-refresh .main-content {
  background: var(--ur-bg);
  padding: 1.75rem 2rem 3rem;
}
@media (max-width: 768px) {
  body.ui-refresh .main-content {
    padding: 1rem 1rem 2rem;
  }
}

/* ── ページ見出し ── */
body.ui-refresh .ur-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
body.ui-refresh .ur-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ur-text-main);
  letter-spacing: -0.01em;
  margin: 0;
}

/* ── アラートバナー（画像01上部: 赤・オレンジ2分割） ── */
body.ui-refresh .ur-alert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  body.ui-refresh .ur-alert-grid {
    grid-template-columns: 1fr;
  }
}
body.ui-refresh .ur-alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-radius: var(--ur-radius-md);
  box-shadow: var(--ur-shadow-card);
  gap: 0.75rem;
}
body.ui-refresh .ur-alert-card.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
body.ui-refresh .ur-alert-card.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
body.ui-refresh .ur-alert-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
body.ui-refresh .ur-alert-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}
body.ui-refresh .ur-alert-badge.red {
  background: #ef4444;
}
body.ui-refresh .ur-alert-badge.orange {
  background: #f59e0b;
}
body.ui-refresh .ur-alert-text {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
body.ui-refresh .ur-alert-link {
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
body.ui-refresh .ur-alert-card.danger .ur-alert-link {
  color: #dc2626;
}
body.ui-refresh .ur-alert-card.danger .ur-alert-link:hover {
  background: rgba(220, 38, 38, 0.08);
}
body.ui-refresh .ur-alert-card.warning .ur-alert-link {
  color: #d97706;
}
body.ui-refresh .ur-alert-card.warning .ur-alert-link:hover {
  background: rgba(217, 119, 6, 0.08);
}

/* ── クイック操作カード（画像01中段） ── */
body.ui-refresh .ur-quick-bar {
  background: var(--ur-card-bg);
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  box-shadow: var(--ur-shadow-card);
  flex-wrap: wrap;
  gap: 0.75rem;
}
body.ui-refresh .ur-quick-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ur-text-main);
}
body.ui-refresh .ur-quick-btns {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
body.ui-refresh .ur-btn-primary {
  background: var(--ur-primary);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--ur-radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  border: 1px solid var(--ur-primary);
}
body.ui-refresh .ur-btn-primary:hover {
  background: var(--ur-primary-hover);
  border-color: var(--ur-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}
body.ui-refresh .ur-btn-outline {
  background: #ffffff;
  color: var(--ur-text-main);
  padding: 0.5rem 0.9rem;
  border-radius: var(--ur-radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--ur-border);
  transition: all 0.15s ease;
}
body.ui-refresh .ur-btn-outline:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--ur-primary);
}

/* ── 4×2 KPIカードグリッド（画像01） ── */
body.ui-refresh .ur-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1100px) {
  body.ui-refresh .ur-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  body.ui-refresh .ur-kpi-grid {
    grid-template-columns: 1fr;
  }
}
body.ui-refresh .ur-kpi-card {
  background: var(--ur-card-bg);
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--ur-shadow-card);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
body.ui-refresh .ur-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ur-shadow-hover);
}
body.ui-refresh .ur-kpi-card.accent-purple { border-left: 4px solid #6366f1; }
body.ui-refresh .ur-kpi-card.accent-red    { border-left: 4px solid #ef4444; }
body.ui-refresh .ur-kpi-card.accent-green  { border-left: 4px solid #10b981; }
body.ui-refresh .ur-kpi-card.accent-orange { border-left: 4px solid #f59e0b; }

body.ui-refresh .ur-kpi-icon {
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ur-bg);
  flex-shrink: 0;
}
body.ui-refresh .ur-kpi-body {
  flex: 1;
  min-width: 0;
}
body.ui-refresh .ur-kpi-val {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
body.ui-refresh .ur-kpi-val.c-blue   { color: #2563eb; }
body.ui-refresh .ur-kpi-val.c-orange { color: #f97316; }
body.ui-refresh .ur-kpi-val.c-gold   { color: #d97706; }
body.ui-refresh .ur-kpi-val.c-green  { color: #10b981; }
body.ui-refresh .ur-kpi-val.c-purple { color: #6366f1; }
body.ui-refresh .ur-kpi-val.c-red    { color: #ef4444; }

body.ui-refresh .ur-kpi-lbl {
  font-size: 0.78rem;
  color: var(--ur-text-muted);
  font-weight: 700;
  margin-top: 4px;
}

/* ── 2カラムレイアウト（稼働状況 ＆ 要対応アクション） ── */
body.ui-refresh .ur-dash-two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
@media (max-width: 1024px) {
  body.ui-refresh .ur-dash-two-col {
    grid-template-columns: 1fr;
  }
}

/* 稼働状況パネル */
body.ui-refresh .ur-panel {
  background: var(--ur-card-bg);
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-md);
  box-shadow: var(--ur-shadow-card);
  overflow: hidden;
}
body.ui-refresh .ur-work-header {
  background: #111827;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
body.ui-refresh .ur-work-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
}
body.ui-refresh .ur-work-header-right {
  font-size: 0.78rem;
  color: #9ca3af;
  font-family: ui-monospace, monospace;
}
body.ui-refresh .ur-work-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  padding: 1.25rem;
  gap: 1.25rem;
}
@media (max-width: 640px) {
  body.ui-refresh .ur-work-body {
    grid-template-columns: 1fr;
  }
}
body.ui-refresh .ur-work-subcol {
  min-width: 0;
}
body.ui-refresh .ur-work-subcol:first-child {
  border-right: 1px solid var(--ur-border-light);
  padding-right: 1.25rem;
}
@media (max-width: 640px) {
  body.ui-refresh .ur-work-subcol:first-child {
    border-right: none;
    border-bottom: 1px solid var(--ur-border-light);
    padding-right: 0;
    padding-bottom: 1.25rem;
  }
}
body.ui-refresh .ur-work-subhead {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ur-text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 稼働中メンバーカード（DOM契約: #active-card-{id}, [id^="elapsed-"], data-started） */
body.ui-refresh .ur-active-card {
  background: #f8fafc;
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.6rem;
  transition: all 0.15s;
}
body.ui-refresh .ur-active-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
body.ui-refresh .ur-member-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ur-text-main);
}
body.ui-refresh .ur-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
body.ui-refresh .ur-timer-badge {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
}
body.ui-refresh .ur-active-task-name {
  font-size: 0.76rem;
  color: var(--ur-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.45rem;
}
body.ui-refresh .ur-active-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}
body.ui-refresh .ur-btn-stop {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
body.ui-refresh .ur-btn-stop:hover { opacity: 0.85; }
body.ui-refresh .ur-btn-cancel {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #64748b;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
body.ui-refresh .ur-btn-cancel:hover { opacity: 0.85; }

/* 今日の工数バーリスト */
body.ui-refresh .ur-bar-row {
  margin-bottom: 0.75rem;
}
body.ui-refresh .ur-bar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
}
body.ui-refresh .ur-bar-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
body.ui-refresh .ur-bar-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* 要対応アクションリスト（画像01右側） */
body.ui-refresh .ur-panel-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--ur-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
body.ui-refresh .ur-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ur-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
body.ui-refresh .ur-action-list {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
body.ui-refresh .ur-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--ur-radius-sm);
  background: #ffffff;
  border: 1px solid var(--ur-border);
  gap: 0.75rem;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  color: inherit;
}
body.ui-refresh .ur-action-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
body.ui-refresh .ur-action-card.border-red  { border-left: 4px solid #ef4444; background: #fffbfb; }
body.ui-refresh .ur-action-card.border-blue { border-left: 4px solid #3b82f6; background: #fbfdff; }

body.ui-refresh .ur-action-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
body.ui-refresh .ur-action-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
body.ui-refresh .ur-action-dot.red  { background: #ef4444; }
body.ui-refresh .ur-action-dot.blue { background: #3b82f6; }

body.ui-refresh .ur-action-titles {
  min-width: 0;
}
body.ui-refresh .ur-action-company {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ur-text-main);
  line-height: 1.3;
}
body.ui-refresh .ur-action-sub {
  font-size: 0.75rem;
  color: var(--ur-text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.ui-refresh .ur-action-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}
body.ui-refresh .ur-action-badge.red {
  background: #fee2e2;
  color: #991b1b;
}
body.ui-refresh .ur-action-badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

/* ── 最近の発注依頼パネル（ダッシュボード上部・新規依頼強調） ── */
body.ui-refresh .ur-dash-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
body.ui-refresh .ur-dash-col > .ur-panel {
  margin-bottom: 0;
}
/* ハーフ幅ではカード内を縦積み（情報 → ステータス/ボタン） */
body.ui-refresh .ur-dash-col .ur-req-card {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
body.ui-refresh .ur-dash-col .ur-req-side {
  justify-content: flex-end;
  flex-wrap: wrap;
}
body.ui-refresh .ur-dash-col .ur-req-alert {
  flex-wrap: wrap;
}
body.ui-refresh .ur-req-panel {
  margin-bottom: 1.5rem;
}
body.ui-refresh .ur-req-panel.has-new {
  border: 2px solid #f87171;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08), var(--ur-shadow-card);
}
body.ui-refresh .ur-req-count {
  font-size: 0.72rem;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  animation: urReqPulse 1.6s ease-in-out infinite;
}
body.ui-refresh .ur-req-all {
  font-size: 0.78rem;
  color: var(--ur-primary);
  text-decoration: none;
  font-weight: 700;
}
body.ui-refresh .ur-req-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 1.25rem 0;
  padding: 0.8rem 1rem;
  background: linear-gradient(90deg, #fef2f2, #fff7ed);
  border: 1px solid #fecaca;
  border-radius: var(--ur-radius-sm);
  color: #991b1b;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}
body.ui-refresh .ur-req-alert:hover {
  background: linear-gradient(90deg, #fee2e2, #ffedd5);
}
body.ui-refresh .ur-req-alert strong {
  font-size: 1.05rem;
  font-weight: 900;
}
body.ui-refresh .ur-req-alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  animation: urReqBell 2s ease-in-out infinite;
  transform-origin: top center;
}
body.ui-refresh .ur-req-alert-text {
  flex: 1;
  min-width: 0;
}
body.ui-refresh .ur-req-alert-link {
  flex-shrink: 0;
  background: #ef4444;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
body.ui-refresh .ur-req-list {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
body.ui-refresh .ur-req-empty {
  text-align: center;
  color: var(--ur-text-muted);
  font-size: 0.82rem;
  padding: 1rem;
  margin: 0;
}
body.ui-refresh .ur-req-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--ur-border);
  border-left: 4px solid #cbd5e1;
  border-radius: var(--ur-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
body.ui-refresh .ur-req-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
body.ui-refresh .ur-req-card.is-new {
  border-color: #fecaca;
  border-left: 5px solid #ef4444;
  background: #fff5f5;
}
body.ui-refresh .ur-req-main {
  min-width: 0;
  flex: 1;
}
body.ui-refresh .ur-req-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}
body.ui-refresh .ur-req-new {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: #ef4444;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  animation: urReqPulse 1.6s ease-in-out infinite;
}
body.ui-refresh .ur-req-company {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ur-text-main);
}
body.ui-refresh .ur-req-requester {
  font-size: 0.78rem;
  color: var(--ur-text-muted);
}
body.ui-refresh .ur-req-time {
  font-size: 0.74rem;
  color: var(--ur-text-muted);
  margin-left: auto;
  white-space: nowrap;
}
body.ui-refresh .ur-req-card.is-new .ur-req-time {
  color: #dc2626;
  font-weight: 700;
}
body.ui-refresh .ur-req-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ur-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.ui-refresh .ur-req-preview {
  font-size: 0.76rem;
  color: var(--ur-text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.ui-refresh .ur-req-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
body.ui-refresh .ur-req-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
}
body.ui-refresh .ur-req-unread {
  font-size: 0.7rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
body.ui-refresh .ur-req-cta {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ur-primary);
  white-space: nowrap;
}
body.ui-refresh .ur-req-card.is-new .ur-req-cta {
  background: #ef4444;
  color: #fff;
  padding: 5px 11px;
  border-radius: 6px;
}
@keyframes urReqPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
@keyframes urReqBell {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30%      { transform: rotate(14deg); }
  20%, 40%      { transform: rotate(-14deg); }
}
@media (prefers-reduced-motion: reduce) {
  body.ui-refresh .ur-req-count,
  body.ui-refresh .ur-req-new,
  body.ui-refresh .ur-req-alert-icon {
    animation: none;
  }
}
@media (max-width: 640px) {
  body.ui-refresh .ur-req-card,
  body.ui-refresh .ur-req-alert {
    flex-direction: column;
    align-items: flex-start;
  }
  body.ui-refresh .ur-req-side {
    flex-wrap: wrap;
  }
  body.ui-refresh .ur-req-time {
    margin-left: 0;
  }
}

/* ── モバイル対応: トップバー＆汎用最小幅 ── */
body.ui-refresh .topbar {
  height: auto;
  min-height: var(--topbar-height);
  padding: 0.75rem 1rem;
}

/* ── レスポンシブ グリッドクラス（インライン指定のクラス化） ── */
body.ui-refresh .ur-grid-overdue {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 0.75rem;
}

body.ui-refresh .ur-grid-comments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 0.75rem;
}

body.ui-refresh .ur-grid-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

body.ui-refresh .ur-grid-quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 0.75rem;
}

/* 子要素の最小幅リセットによる横スクロール防止 */
body.ui-refresh .ur-grid-overdue > *,
body.ui-refresh .ur-grid-comments > *,
body.ui-refresh .ur-grid-split > *,
body.ui-refresh .ur-grid-quick > *,
body.ui-refresh .ur-work-body > *,
body.ui-refresh .ur-panel,
body.ui-refresh .ur-alert-card,
body.ui-refresh .ur-kpi-card {
  min-width: 0;
}

/* ブレークポイント別1列化強制 */
@media (max-width: 900px) {
  body.ui-refresh .ur-grid-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.ui-refresh .ur-grid-overdue,
  body.ui-refresh .ur-grid-comments,
  body.ui-refresh .ur-grid-split,
  body.ui-refresh .ur-grid-quick {
    grid-template-columns: 1fr;
  }
  body.ui-refresh .ur-alert-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  body.ui-refresh .ur-alert-link {
    align-self: flex-end;
  }
}

/* ── Phase 2: モダンカード・テーブル・一覧共通スタイル ── */
body.ui-refresh .card {
  background: var(--ur-card-bg);
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-md);
  box-shadow: var(--ur-shadow-card);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

body.ui-refresh .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--ur-border-light);
  background: #ffffff;
  flex-wrap: wrap;
  gap: 0.75rem;
}

body.ui-refresh .card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ur-text-main);
  letter-spacing: -0.01em;
  margin: 0;
}

body.ui-refresh .card-toolbar {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--ur-border-light);
  background: #f8fafc;
}

body.ui-refresh .card-body {
  padding: 1.25rem 1.5rem;
}

/* フォーム・検索入力 */
body.ui-refresh input[type="text"].form-control,
body.ui-refresh .search-input,
body.ui-refresh .card-toolbar input[type="text"] {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-sm);
  font-size: 0.86rem;
  color: var(--ur-text-main);
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

body.ui-refresh input[type="text"].form-control:focus,
body.ui-refresh .search-input:focus,
body.ui-refresh .card-toolbar input[type="text"]:focus {
  border-color: var(--ur-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* フィルタタブ */
body.ui-refresh .status-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

body.ui-refresh .filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--ur-border);
  background: #ffffff;
  color: var(--ur-text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

body.ui-refresh .filter-tab:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: var(--ur-text-main);
}

body.ui-refresh .filter-tab.active {
  background: var(--ur-primary);
  border-color: var(--ur-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

/* 一覧テーブル */
body.ui-refresh .ur-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.ui-refresh .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

body.ui-refresh .table th {
  background: #f8fafc;
  color: var(--ur-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ur-border);
  white-space: nowrap;
}

body.ui-refresh .table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ur-border-light);
  color: var(--ur-text-main);
  vertical-align: middle;
}

body.ui-refresh .table tbody tr {
  transition: background-color 0.12s ease;
}

body.ui-refresh .table tbody tr:hover {
  background-color: #f8fafc;
}

body.ui-refresh .table-hover tbody tr:hover {
  background-color: #f8fafc;
}

body.ui-refresh .table td.actions {
  white-space: nowrap;
  text-align: right;
}

body.ui-refresh .table td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ボタン */
body.ui-refresh .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  border-radius: var(--ur-radius-sm);
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

body.ui-refresh .btn-primary {
  background: var(--ur-primary);
  border-color: var(--ur-primary);
  color: #ffffff;
}

body.ui-refresh .btn-primary:hover {
  background: var(--ur-primary-hover);
  border-color: var(--ur-primary-hover);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  color: #ffffff;
}

body.ui-refresh .btn-outline {
  background: #ffffff;
  border-color: var(--ur-border);
  color: var(--ur-text-main);
}

body.ui-refresh .btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ur-primary);
}

body.ui-refresh .btn-secondary {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

body.ui-refresh .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.ui-refresh .btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

body.ui-refresh .btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

body.ui-refresh .btn-xs {
  font-size: 0.74rem;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
}

body.ui-refresh .btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

/* バッジ */
body.ui-refresh .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  line-height: 1.2;
}

body.ui-refresh .badge-success { background: #dcfce7; color: #15803d; }
body.ui-refresh .badge-warning { background: #fef3c7; color: #92400e; }
body.ui-refresh .badge-danger  { background: #fee2e2; color: #991b1b; }
body.ui-refresh .badge-info    { background: #dbeafe; color: #1e40af; }
body.ui-refresh .badge-muted   { background: #f1f5f9; color: #64748b; }

/* ============================================================
   SALUTO 2026 UI REFRESH - モバイル・タブレット用カードビュー (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* テーブルコンテナの横スクロールを解除し、自然なブロック配置へ */
  body.ui-refresh .ur-table-container {
    overflow-x: visible !important;
    padding: 0 12px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body.ui-refresh .card-body {
    overflow-x: visible !important;
    padding-bottom: 90px !important;
  }

  /* テーブル自体をカードリストコンテナへ変換（レガシーのmin-width: 480px/560pxを完全リセット） */
  body.ui-refresh .table,
  body.ui-refresh .table-wrap .table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
  }

  body.ui-refresh .table thead {
    display: none !important;
  }

  body.ui-refresh .table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 4px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 各行（tr）を1つの独立したカードとして描画 */
  body.ui-refresh .table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1px solid var(--ur-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    gap: 8px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
  }
  body.ui-refresh .table tbody tr:hover {
    background: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07) !important;
  }

  /* 各セル（td）をラベル＋値の横並び行として表示 */
  body.ui-refresh .table td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    border: none !important;
    border-bottom: 1px dashed var(--ur-border-light) !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: right !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* data-label 属性によるラベル表示 */
  body.ui-refresh .table td::before {
    content: attr(data-label);
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    color: var(--ur-text-muted) !important;
    text-align: left !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
  }
  body.ui-refresh .table td:not([data-label])::before,
  body.ui-refresh .table td[data-label=""]::before {
    display: none !important;
  }

  /* 会社名・クライアント名などタイトルセル */
  body.ui-refresh .table td.col-card-title,
  body.ui-refresh .table td[data-label="会社名"],
  body.ui-refresh .table td[data-label="クライアント"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-bottom: 10px !important;
    margin-bottom: 4px !important;
    border-bottom: 2px solid var(--ur-border-light) !important;
    text-align: left !important;
  }

  body.ui-refresh .table td.col-card-title strong,
  body.ui-refresh .table td[data-label="会社名"] strong,
  body.ui-refresh .table td[data-label="クライアント"] strong {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: var(--ur-text-main) !important;
  }

  body.ui-refresh .table td.col-card-title::before,
  body.ui-refresh .table td[data-label="会社名"]::before,
  body.ui-refresh .table td[data-label="クライアント"]::before {
    font-size: 0.72rem !important;
    color: var(--ur-primary) !important;
    margin-bottom: 2px !important;
  }

  /* 件名セル（一文字ずつ改行させず左揃え） */
  body.ui-refresh .table td[data-label="件名"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 4px !important;
    font-weight: 600 !important;
  }
  body.ui-refresh .table td[data-label="件名"]::before {
    margin-bottom: 2px !important;
  }

  /* 金額セル */
  body.ui-refresh .table td[data-label="金額"],
  body.ui-refresh .table td[data-label="金額（税込）"] {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: var(--ur-primary) !important;
  }

  /* 下書き選択チェックボックスセル */
  body.ui-refresh .table td.col-check {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #fffbeb !important;
    border: 1px solid #fef3c7 !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
  }
  body.ui-refresh .table td.col-check-empty {
    display: none !important;
  }
  body.ui-refresh .table td.col-check:empty {
    display: none !important;
  }
  body.ui-refresh .table td.col-check::before {
    display: none !important;
  }
  body.ui-refresh .table td.col-check input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer !important;
  }

  /* ステータス列（バッジやアクションリンク） */
  body.ui-refresh .table td[data-label="ステータス"] {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }
  body.ui-refresh .table td[data-label="ステータス"] a {
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 0.78rem !important;
  }

  /* 操作ボタングループ（カード下部に横スクロールなしで配置、44pxタップ領域を確保） */
  body.ui-refresh .table td.actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 14px !important;
    border-top: 1px solid var(--ur-border) !important;
    border-bottom: none !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
  body.ui-refresh .table td.actions::before {
    display: none !important;
  }
  body.ui-refresh .table td.actions .btn,
  body.ui-refresh .table td.actions a.btn,
  body.ui-refresh .table td.actions button {
    min-height: 44px !important;
    min-width: 0 !important;
    flex: 1 1 calc(50% - 8px) !important;
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
  }
  body.ui-refresh .table td.actions form {
    display: inline-flex !important;
    min-width: 0 !important;
    flex: 1 1 calc(50% - 8px) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .table td.actions form button {
    width: 100% !important;
    min-height: 44px !important;
  }

  .mobile-only-label {
    display: inline !important;
  }
  .ur-mobile-bulk-header {
    display: block !important;
    padding: 0 12px;
  }
}

@media (min-width: 769px) {
  .mobile-only-label {
    display: none !important;
  }
  .ur-mobile-bulk-header {
    display: none !important;
  }
}

/* ==========================================================================
   Phase 4: SALUTO UI/UX Refresh - 契約管理・サイト監視・セキュリティ診断
   ========================================================================== */

/* ─── 顧客契約一覧 (admin/contracts/index.php) ─── */
body.ui-refresh .cc-block {
  border: 1px solid var(--ur-border);
  border-radius: var(--ur-radius-md);
  box-shadow: var(--ur-shadow-card);
  margin-bottom: 20px;
  background: var(--ur-bg-card);
}
body.ui-refresh .cc-block-head {
  padding: 12px 18px;
  background: var(--ur-bg-sub);
  border-bottom: 1px solid var(--ur-border);
  flex-wrap: wrap;
  gap: 10px;
}
body.ui-refresh .cc-summary {
  gap: 10px;
}
body.ui-refresh .cc-badge {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
}
body.ui-refresh .cc-tbl th {
  padding: 10px 14px;
  font-weight: 700;
  background: var(--ur-bg-sub);
  color: var(--ur-text-muted);
}
body.ui-refresh .cc-tbl td {
  padding: 12px 14px;
}

/* ─── サイト監視ダッシュボード (admin/monitor/index.php) ─── */
body.ui-refresh .monitor-grid {
  gap: 20px;
}
body.ui-refresh .stat-mini {
  border-radius: var(--ur-radius-md);
  box-shadow: var(--ur-shadow-card);
  border: 1px solid var(--ur-border);
  padding: 14px 20px;
  min-width: 130px;
}
body.ui-refresh .status-badge {
  padding: 4px 10px;
  font-weight: 700;
  border-radius: 999px;
  font-size: 0.78rem;
}

/* ─── WPセキュリティ詳細 (admin/monitor/wp_security_detail.php) ─── */
body.ui-refresh .wp-chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ─── モバイル・タブレット最適化 (<= 768px) ─── */
@media (max-width: 768px) {
  /* 顧客契約一覧のカード化 */
  body.ui-refresh .cc-block-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }
  body.ui-refresh .cc-block-head > div:last-child {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  body.ui-refresh .cc-tbl,
  body.ui-refresh .cc-tbl colgroup,
  body.ui-refresh .cc-tbl thead,
  body.ui-refresh .cc-tbl tbody,
  body.ui-refresh .cc-tbl tr,
  body.ui-refresh .cc-tbl td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .cc-tbl thead {
    display: none !important;
  }
  body.ui-refresh .cc-tbl tr {
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--ur-border-light) !important;
    background: #ffffff !important;
  }
  body.ui-refresh .cc-tbl tr:last-child {
    border-bottom: none !important;
  }
  body.ui-refresh .cc-tbl td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    font-size: 0.85rem !important;
    white-space: normal !important;
    max-width: none !important;
    overflow: visible !important;
  }
  body.ui-refresh .cc-tbl td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ur-text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
    margin-right: 12px;
  }
  body.ui-refresh .cc-tbl td.cc-cell-svc {
    display: block !important;
    font-weight: 700;
    font-size: 0.95rem !important;
    color: var(--ur-text-main);
    border-bottom: 1px solid var(--ur-border) !important;
    padding-bottom: 8px !important;
    margin-bottom: 6px !important;
  }
  body.ui-refresh .cc-tbl td.cc-cell-svc::before {
    display: none !important;
  }
  body.ui-refresh .cc-tbl td.cc-cell-act {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    border-bottom: none !important;
    padding-top: 10px !important;
  }
  body.ui-refresh .cc-tbl td.cc-cell-act::before {
    display: none !important;
  }
  body.ui-refresh .cc-tbl td.cc-cell-act .btn {
    min-height: 44px !important;
    min-width: 80px !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* 契約一覧 +追加ボタン */
  body.ui-refresh .cc-block-head a.btn,
  body.ui-refresh .cc-block-head .btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* カードヘッダー内 戻るボタン等 */
  body.ui-refresh .card-header a.btn,
  body.ui-refresh .card-header .btn {
    min-height: 44px !important;
    padding: 8px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* 監視設定等の補助ボタン */
  body.ui-refresh .monitor-grid a.btn,
  body.ui-refresh .monitor-grid button.btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* サイト管理 テーブルカード化 */
  body.ui-refresh .table td.actions .btn {
    min-height: 44px !important;
    min-width: 70px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
  }

  /* サイト管理 フィルターフォームの余白解消 */
  body.ui-refresh .client-filter-form > .form-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  body.ui-refresh .client-filter-form > .form-row > .form-group {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
  }
  body.ui-refresh .client-filter-form select[name="client_id"] {
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .client-filter-form .form-group > div {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
  }
  body.ui-refresh .client-filter-form input[name="keyword"] {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .client-filter-form button[type="submit"] {
    min-height: 44px !important;
    width: auto !important;
    padding: 0 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  /* サイト管理 新規サイト追加フォーム */
  body.ui-refresh .card-body form:not(.client-filter-form) .form-group:last-child button[type="submit"] {
    min-height: 44px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* 契約登録・編集フォームのボタン統一 */
  body.ui-refresh .card form button[type="submit"],
  body.ui-refresh .card form .btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* サイト監視ダッシュボード テーブルカード化 */
  body.ui-refresh .client-monitor-table,
  body.ui-refresh .client-monitor-table colgroup,
  body.ui-refresh .client-monitor-table thead,
  body.ui-refresh .client-monitor-table tbody,
  body.ui-refresh .client-monitor-table tr,
  body.ui-refresh .client-monitor-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .client-monitor-table thead {
    display: none !important;
  }
  body.ui-refresh .client-monitor-table tr {
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--ur-border-light) !important;
    background: #ffffff !important;
  }
  body.ui-refresh .client-monitor-table tr:last-child {
    border-bottom: none !important;
  }
  body.ui-refresh .client-monitor-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    font-size: 0.85rem !important;
    white-space: normal !important;
    overflow: visible !important;
  }
  body.ui-refresh .client-monitor-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ur-text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
    margin-right: 12px;
  }
  body.ui-refresh .client-monitor-table td[data-label="サイト名 / URL"] {
    display: block !important;
    border-bottom: 1px solid var(--ur-border) !important;
    padding-bottom: 8px !important;
    margin-bottom: 6px !important;
  }
  body.ui-refresh .client-monitor-table td[data-label="サイト名 / URL"]::before {
    display: none !important;
  }
  body.ui-refresh .client-monitor-table td.actions {
    display: flex !important;
    justify-content: flex-end !important;
    border-bottom: none !important;
    padding-top: 10px !important;
  }
  body.ui-refresh .client-monitor-table td.actions::before {
    display: none !important;
  }
  body.ui-refresh .client-monitor-table td.actions .btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* サイト監視 検索入力・ボタン */
  body.ui-refresh .monitor-grid form input[name="keyword"] {
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .monitor-grid form button[type="submit"] {
    min-height: 44px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* WPセキュリティ詳細 ボタン & コピー・タスク登録 */
  body.ui-refresh a[href*="monitor/index.php"].btn,
  body.ui-refresh a[href*="monitor/index.php"] {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh button[onclick*="copyCode"] {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
  }
  body.ui-refresh button[onclick*="addSecurityTask"],
  body.ui-refresh .btn-xs {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
  }

  /* トップバー・サイドバーの操作要素 44px */
  body.ui-refresh .sidebar-toggle {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 1.4rem !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .topbar-guide-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 14px !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .nav-info-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    right: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .nav-menu a {
    padding-right: 48px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .alert-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* モバイルフォーム要素・ボタン 44px 統一 */
  body.ui-refresh .form-control,
  body.ui-refresh input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  body.ui-refresh select,
  body.ui-refresh textarea {
    min-height: 44px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
  }
  body.ui-refresh .btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh label:has(input[type="checkbox"]),
  body.ui-refresh label:has(input[type="radio"]) {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
  }
  body.ui-refresh input[type="checkbox"],
  body.ui-refresh input[type="radio"] {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
    accent-color: #2563eb !important;
    margin: 0 8px 0 0 !important;
  }
  body.ui-refresh .logout-btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .admin-guide-close-btn,
  body.ui-refresh .admin-ai-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .admin-guide-ai-btn,
  body.ui-refresh .admin-ai-chip,
  body.ui-refresh .admin-ai-send-btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  body.ui-refresh .admin-ai-input {
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  /* 検索バー・フォームのモバイル折り返し */
  body.ui-refresh .card-header {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  body.ui-refresh .card-header > div {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  body.ui-refresh .form-row {
    flex-direction: column !important;
  }
  body.ui-refresh .form-group[class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* ==========================================================================
   Phase 5: 管理側 請求書作成・編集 UIリフレッシュ & モバイル縦型カード化
   スコープ: body.ui-refresh 配下のみに完全限定適用
   ========================================================================== */

body.ui-refresh #items-table {
  width: 100%;
  border-collapse: collapse;
}

/* デスクトップ・タブレット表示 */
body.ui-refresh #items-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid #e2e8f0;
}
body.ui-refresh #items-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* モバイル (max-width: 640px) 請求明細の「縦型カードレイアウト」 */
@media (max-width: 640px) {
  body.ui-refresh #items-table,
  body.ui-refresh #items-table tbody,
  body.ui-refresh #items-table tfoot {
    display: block !important;
    width: 100% !important;
  }
  body.ui-refresh #items-table thead {
    display: none !important;
  }
  
  /* 各明細行（動的追加行も同一クラス .item-row）を独立カード化 */
  body.ui-refresh #items-table tbody .item-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
  }
  
  body.ui-refresh #items-table tbody .item-row td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }
  
  /* 入力フィールドの44px保証 */
  body.ui-refresh #items-table input[type="text"],
  body.ui-refresh #items-table input[type="number"],
  body.ui-refresh #items-table select {
    min-height: 44px !important;
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
  }
  
  /* 操作ボタン（削除・移動・切替）の44px保証 */
  body.ui-refresh #items-table button,
  body.ui-refresh #items-table .btn,
  body.ui-refresh #create-form button,
  body.ui-refresh #items-form button {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  
  /* 合計欄フッター */
  body.ui-refresh #items-table tfoot tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.65rem 0.75rem !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    margin-bottom: 0.4rem !important;
  }
  body.ui-refresh #items-table tfoot td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }
  
  /* フォーム日付・支払グリッドの1カラム化 */
  body.ui-refresh #create-form div[style*="grid-template-columns"],
  body.ui-refresh #items-form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  /* 画面全体の不要な横スクロール排除 */
  body.ui-refresh,
  body.ui-refresh .container-fluid,
  body.ui-refresh .admin-main {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}




