/* ============================================================
   案件管理システム — スタイルシート
   ============================================================ */

/* ----- CSS カスタムプロパティ ----- */
:root {
  --sidebar-w:       240px;
  --bg:              #F1F5F9;
  --sidebar:         #0F172A;
  --sidebar-hover:   #1E293B;
  --sidebar-active:  #3B82F6;
  --sidebar-text:    #94A3B8;
  --sidebar-text-on: #F8FAFC;
  --primary:         #3B82F6;
  --primary-d:       #2563EB;
  --success:         #22C55E;
  --warning:         #F59E0B;
  --danger:          #EF4444;
  --orange:          #F97316;
  --purple:          #8B5CF6;
  --text:            #1E293B;
  --text-2:          #64748B;
  --border:          #E2E8F0;
  --white:           #FFFFFF;
  --radius:          8px;
  --shadow:          0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:       0 4px 6px rgba(0,0,0,.07);
}

/* ----- リセット ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   レイアウト
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s ease;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   サイドバー
   ============================================================ */
.sidebar__header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar__logo {
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar__logo span {
  display: block;
  font-size: 10px;
  color: var(--sidebar-text);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: .02em;
}
.sidebar__nav { padding: 12px 10px; flex: 1; }
.sidebar__section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sidebar-text);
  padding: 10px 8px 4px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}
.sidebar__link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-on); text-decoration: none; }
.sidebar__link.active { background: var(--sidebar-active); color: var(--sidebar-text-on); }
.sidebar__link i { width: 16px; text-align: center; opacity: .8; font-size: 13px; }
.sidebar__footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__username {
  font-size: 12px; font-weight: 600;
  color: var(--sidebar-text-on);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__role { font-size: 11px; color: var(--sidebar-text); }
.sidebar__logout {
  color: var(--sidebar-text);
  font-size: 15px;
  padding: 4px;
  flex-shrink: 0;
  transition: color .15s;
}
.sidebar__logout:hover { color: var(--danger); text-decoration: none; }

/* ============================================================
   トップバー
   ============================================================ */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.topbar__title { font-size: 17px; font-weight: 700; color: var(--text); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.hamburger {
  display: none;
  background: none; border: none;
  font-size: 18px; color: var(--text);
  cursor: pointer; padding: 4px 8px;
  margin-right: 8px;
}

/* ============================================================
   コンテンツエリア
   ============================================================ */
.content { padding: 24px; flex: 1; }

/* ============================================================
   ページヘッダー
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header__title { font-size: 22px; font-weight: 700; }
.page-header__sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* ============================================================
   統計カード
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-card__icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-card__icon--blue   { background: #EFF6FF; color: var(--primary); }
.stat-card__icon--green  { background: #F0FDF4; color: #16A34A; }
.stat-card__icon--orange { background: #FFF7ED; color: var(--orange); }
.stat-card__icon--red    { background: #FEF2F2; color: var(--danger); }
.stat-card__icon--purple { background: #F5F3FF; color: var(--purple); }
.stat-card__label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.stat-card__value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card__sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ============================================================
   カード
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card__title { font-size: 15px; font-weight: 600; }
.card__body { padding: 20px; }

/* ============================================================
   テーブル
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-2);
  background: #F8FAFC;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFC; }
.td-name { font-weight: 600; }
.td-amount { font-weight: 700; color: var(--primary-d); }

/* ============================================================
   バッジ（ステータス）
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge--gray   { background: #F1F5F9; color: #64748B; }
.badge--blue   { background: #EFF6FF; color: #1D4ED8; }
.badge--yellow { background: #FEFCE8; color: #A16207; }
.badge--orange { background: #FFF7ED; color: #C2410C; }
.badge--green  { background: #F0FDF4; color: #15803D; }
.badge--red    { background: #FEF2F2; color: #DC2626; }

/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(.93); }
.btn--primary  { background: var(--primary);  color: white; }
.btn--success  { background: var(--success);  color: white; }
.btn--danger   { background: var(--danger);   color: white; }
.btn--warning  { background: var(--warning);  color: white; }
.btn--purple   { background: var(--purple);   color: white; }
.btn--outline  { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--outline:hover { background: var(--bg); filter: none; }
.btn--sm  { padding: 5px 10px; font-size: 12px; }
.btn--lg  { padding: 11px 22px; font-size: 15px; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============================================================
   フォーム
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint  { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger);  margin-top: 4px; }

/* ---- 追加費用フィールド ---- */
.extras-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.extras-header {
  display: grid;
  grid-template-columns: 1fr 150px 40px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .05em;
}
.extra-row {
  display: grid;
  grid-template-columns: 1fr 150px 40px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.extra-row:last-child { border-bottom: none; }
.extra-row input {
  border: none;
  border-right: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: transparent;
}
.extra-row input:last-of-type { border-right: 1px solid var(--border); }
.extra-row input:focus { outline: none; background: #EFF6FF; }
.extra-row__del {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--danger);
  cursor: pointer;
  background: none; border: none;
  font-size: 15px; padding: 8px;
}
.extra-row__del:hover { background: #FEF2F2; }
.extras-add {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px; color: var(--primary);
  background: #F8FAFC; border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex; align-items: center; gap: 6px;
  transition: background .15s;
}
.extras-add:hover { background: #EFF6FF; }

/* ---- 金額サマリー ---- */
.amount-summary {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 8px;
}
.amount-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; padding: 4px 0;
}
.amount-row--total {
  border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 10px;
  font-weight: 700; font-size: 16px;
  color: var(--primary-d);
}

/* ============================================================
   コメント
   ============================================================ */
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 12px; }
.comment__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.comment__avatar--admin  { background: var(--primary); }
.comment__avatar--client { background: var(--purple); }
.comment__body {
  flex: 1;
  background: #F8FAFC;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.comment__meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.comment__author { font-size: 13px; font-weight: 600; }
.comment__time { font-size: 11px; color: var(--text-2); }
.comment__text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

/* ============================================================
   ステータスログ
   ============================================================ */
.status-log { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.log-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-2);
}
.log-item::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

/* ============================================================
   フィルターバー
   ============================================================ */
.filter-bar {
  display: flex; gap: 10px;
  align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--white);
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-label { font-size: 11px; }
.filter-bar select,
.filter-bar input { min-width: 120px; }

/* ============================================================
   アラート
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert--info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert--success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #14532D; }
.alert--warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert--danger  { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

/* ============================================================
   詳細グリッド
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.detail-item__label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-2);
  margin-bottom: 4px; font-weight: 600;
}
.detail-item__value { font-size: 15px; color: var(--text); font-weight: 500; }

/* ============================================================
   パンくず
   ============================================================ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb__sep { color: var(--border); }

/* ============================================================
   納期チップ
   ============================================================ */
.deadline--soon { color: var(--warning); font-weight: 600; }
.deadline--past { color: var(--danger);  font-weight: 600; }
.deadline--ok   { color: var(--text); }

/* ============================================================
   空の状態
   ============================================================ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty-state__icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state__text { font-size: 14px; }

/* ============================================================
   ログイン画面
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
}
.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo__icon { font-size: 36px; color: var(--primary); margin-bottom: 10px; }
.login-logo__title { font-size: 20px; font-weight: 700; color: var(--text); }
.login-logo__sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12px; margin: 20px 0; }
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ============================================================
   請求バッジ
   ============================================================ */
.amount-type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  margin-left: 6px;
}
.amount-type-badge--estimate { background: #EFF6FF; color: #1D4ED8; }
.amount-type-badge--budget   { background: #F5F3FF; color: #6D28D9; }

/* ============================================================
   チェックボックス
   ============================================================ */
.cb-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cb-wrap input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ============================================================
   タブ
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
}
.tab {
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  transition: color .15s;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--border); color: var(--text-2);
}
.tab-badge--active { background: var(--primary); color: white; }

/* ============================================================
   ソートリンク
   ============================================================ */
.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.sort-link:hover { color: var(--primary); text-decoration: none; }
.sort-icon--inactive { opacity: .3; }
.sort-icon--active   { color: var(--primary); }

/* ============================================================
   検索ハイライト
   ============================================================ */
mark {
  background: #FEF9C3;
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
}

/* ============================================================
   パスワード表示トグル
   ============================================================ */
.pw-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-2);
  cursor: pointer; padding: 4px;
  font-size: 14px;
}
.pw-toggle:hover { color: var(--text); }

/* ============================================================
   モバイル対応
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 90;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { margin: 16px; padding: 28px 24px; }
}

/* ============================================================
   保守契約 MRR バナー
   ============================================================ */
.retainer-mrr-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 14px;
}
.retainer-mrr-banner i { margin-right: 8px; opacity: .85; }
.retainer-mrr-banner strong { font-size: 20px; font-weight: 700; margin: 0 10px; }
.retainer-mrr-banner__sub { opacity: .8; font-size: 13px; margin-left: 6px; }

/* 保守内バッジ */
.badge--retainer {
  background: #D1FAE5;
  color: #065F46;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

/* 保守契約ヒント */
.retainer-hint { margin-top: 6px; font-size: 13px; }

/* テーブル行：終了した保守契約 */
.tr--muted td { opacity: .55; }

/* ============================================================
   stat-card アラート強調
   ============================================================ */
.stat-card--alert { border-left: 4px solid var(--danger); }
.stat-card--warn  { border-left: 4px solid var(--warning); }
.stat-card__value--sm { font-size: 20px; }

/* ============================================================
   今月売上見込みカード
   ============================================================ */
.forecast-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #F1F5F9;
}
.forecast-bar__seg { height: 100%; transition: width .4s; }
.forecast-bar__seg--paid      { background: #10B981; }
.forecast-bar__seg--invoiced  { background: #3B82F6; }
.forecast-bar__seg--delivered { background: #F59E0B; }
.forecast-bar__seg--progress  { background: #8B5CF6; }
.forecast-bar__seg--pending   { background: #CBD5E1; }

.forecast-breakdown { display: flex; flex-direction: column; gap: 10px; }
.forecast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.forecast-row__left  { display: flex; align-items: center; gap: 8px; }
.forecast-row__label { color: var(--text-1); }
.forecast-row__tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}
.forecast-row__right { display: flex; align-items: center; gap: 10px; }
.forecast-row__amount { font-weight: 600; color: var(--text-1); }
.forecast-row__pct    { font-size: 12px; color: var(--text-2); width: 36px; text-align: right; }

/* ============================================================
   カレンダー凡例
   ============================================================ */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.calendar-legend__item { display: flex; align-items: center; gap: 6px; }
.calendar-legend__dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   インライン編集
   ============================================================ */
.inline-edit {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background .15s;
}
.inline-edit:hover { background: #EFF6FF; }
.inline-edit__icon {
  font-size: 10px;
  color: var(--text-2);
  opacity: 0;
  transition: opacity .15s;
}
.inline-edit:hover .inline-edit__icon { opacity: 1; }
.inline-edit__input {
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 13px;
  outline: none;
  width: 130px;
}

/* ============================================================
   AI 自動入力UI
   ============================================================ */
.btn--ai {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity .15s, transform .1s;
}
.btn--ai:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.btn--ai:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.ai-fill-card .card__header {
  background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
  border-bottom-color: #DDD6FE;
}

.ai-fill-status {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ai-fill-status--success { color: var(--success); }
.ai-fill-status--error   { color: var(--danger); }
.ai-fill-status--loading { color: var(--text-2); }

/* AI入力されたフィールドのフラッシュ */
@keyframes aiFlash {
  0%   { background: #EDE9FE; box-shadow: 0 0 0 2px #7C3AED44; }
  100% { background: transparent; box-shadow: none; }
}
.ai-filled {
  animation: aiFlash 1.5s ease forwards;
  border-color: #7C3AED !important;
}
