/*
 * 更新業務管理アプリ全体の見た目（2026-11-25）
 * 方針: ポータル（portalSkin.css）・内見依頼書（naikenSkin.css）と同じ。
 *   色は紺1色＋グレー。グラデーション・影・色つきの四角アイコン・金色の飾りをやめる。
 *   余白を詰め、スクロールしなくてもページ全体が見渡せるようにする。
 *   見た目だけを変える。ボタン・リンク・表示/非表示など動きには一切触れない。
 *   元に戻すときは src/index.tsx の umSkin.css の <link> を消すだけ。
 * style.css の後に読み込む。インラインの style に勝つ必要があるところだけ !important を使う。
 */
:root {
  --um-ink: #1f2328;
  --um-sub: #5b6470;
  --um-mute: #8a929c;
  --um-line: #e3e6ea;
  --um-line-strong: #cdd2d8;
  --um-bg: #f5f5f3;
  --um-soft: #f8f9fb;
  --um-accent: #23395d;
  --um-accent-hover: #1a2b47;
  --um-accent-soft: #eef2f8;

  /* style.css の色の変数も紺＋グレーに寄せる（金色 → 紺） */
  --primary: #23395d;
  --primary-light: #1a2b47;
  --primary-pale: #eef2f8;
  --accent: #23395d;
  --accent-light: #f6f3ec;
  --gray-bg: #f5f5f3;
}
@media (min-width: 1024px) {
  :root { --sidebar-w: 196px; }
}

html body {
  background: var(--um-bg);
  color: var(--um-ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
 * サイドバー: 色は元の紺のまま（金色の目印も残す）。行の間隔だけ詰める
 * ========================================================= */
html body #sidebar,
html body .mobile-nav-panel { --primary: #1e3a5f; --primary-light: #2d5a8e; --accent: #c8a96e; --accent-light: #f5edd8; }
html body #sidebar .logo { padding: 14px 14px 10px; }
html body #sidebar nav { padding: 4px 0; }
html body #sidebar nav .nav-section { padding: 10px 14px 2px; }
html body #sidebar nav a { padding: 6px 14px; gap: 8px; font-size: 12.5px; }
html body #sidebar nav a.nav-sub-link,
html body #sidebar nav a.nav-sub-sub-link { padding-top: 5px; padding-bottom: 5px; }
html body #sidebar .sidebar-user { padding: 8px 14px; font-size: 11px; }

/* =========================================================
 * 上の帯・ページの余白
 * ========================================================= */
html body #topbar { box-shadow: none; border-bottom-color: var(--um-line); padding: 0 18px; }
html body #topbar .page-title { font-size: 15px; color: var(--um-ink); }
html body .topbar-user-chip { background: transparent; border-color: transparent; }
html body .topbar-user-avatar { background: var(--um-accent-soft); color: var(--um-accent); }
html body .topbar-logout-btn { height: 32px; }

/* 広い画面でも右に空白を残さず、横幅いっぱいに使う */
html body .page-container { padding: 14px 18px 24px; max-width: none; }

/* =========================================================
 * カード
 * ========================================================= */
html body .card {
  border-radius: 6px;
  border: 1px solid var(--um-line);
  box-shadow: none;
}
html body .card-header {
  padding: 7px 12px;
  border-bottom-color: var(--um-line);
  border-radius: 6px 6px 0 0;
  min-height: 0;
}
html body details.card:not([open]) > .card-header { border-bottom: none; border-radius: 6px; }
html body .card-title { font-size: 13px; color: var(--um-ink); gap: 6px; }
html body .card-title i { color: var(--um-mute); font-size: 12px; }
html body .card-body { padding: 12px; }
/* インラインで付いた大きめの間隔を詰める */
html body .page-container .card[style*="margin-bottom:20px"],
html body .page-container .card[style*="margin-bottom: 20px"],
html body .page-container .card[style*="margin-bottom:24px"],
html body .page-container .card[style*="margin-bottom: 24px"] { margin-bottom: 12px !important; }

/* =========================================================
 * 数字のカード: 縦積み（アイコン→数字→名前）をやめ、1行に
 *   ［数字］名前
 *           補足
 * ========================================================= */
html body .page-container > div[style*="minmax(180px"] { gap: 10px !important; margin-bottom: 12px !important; }
html body .stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--um-line);
  box-shadow: none;
}
html body .stat-card .stat-icon { display: none; }
html body .stat-card .stat-value {
  grid-row: 1 / span 2;
  font-size: 22px;
  font-weight: 700;
  color: var(--um-ink);
  font-variant-numeric: tabular-nums;
  align-self: center;
}
html body .stat-card .stat-label { font-size: 12px; color: var(--um-sub); font-weight: 600; }
html body .stat-card .stat-sub { grid-column: 2; font-size: 11px; color: var(--um-mute); }
html body .stat-card .stat-info { display: contents; }

/* =========================================================
 * 表: 行の高さを詰め、狭い列での折り返しを減らす
 * ========================================================= */
html body .data-table { font-size: 12.5px; }
html body .data-table th {
  background: #f3f4f5;
  padding: 6px 8px;
  color: var(--um-sub);
  font-size: 11px;
  text-transform: none;
  letter-spacing: .02em;
  border-bottom-color: var(--um-line);
}
html body .data-table td { padding: 5px 8px; border-bottom-color: #eef0f2; line-height: 1.4; }
html body .data-table tbody tr:hover { background: #f7f8f9; }
html body .data-table td .badge { padding-top: 1px; padding-bottom: 1px; }
/* 表の中の小さな注釈（契約者: 〇〇 など）は1行に収める */
html body .data-table td > div[style*="font-size:11px"],
html body .data-table td > div[style*="font-size: 11px"] { line-height: 1.3; }

/* =========================================================
 * ボタン・バッジ・入力欄
 * ========================================================= */
html body .btn { padding: 6px 12px; border-radius: 5px; font-size: 12.5px; }
html body .btn-sm { padding: 4px 8px; font-size: 12px; }
html body .btn-primary { background: var(--um-accent); }
html body .btn-primary:hover { background: var(--um-accent-hover); }
html body .btn-accent { background: var(--um-accent); }
html body .btn-accent:hover { background: var(--um-accent-hover); }
html body .btn-outline { border-color: var(--um-line-strong); color: var(--um-ink); }
html body .btn-outline:hover { background: var(--um-soft); border-color: var(--um-mute); }
html body .btn-danger { background: #b3362c; }
html body .btn-success { background: #3f7a55; }
html body .badge { border-radius: 3px; }
html body .form-input,
html body .form-select,
html body .form-textarea { border-radius: 5px; border-color: var(--um-line-strong); }
html body .form-input:focus,
html body .form-select:focus,
html body .form-textarea:focus { border-color: var(--um-accent); box-shadow: 0 0 0 3px rgba(35, 57, 93, .12); }
html body .form-label { color: var(--um-sub); }

/* =========================================================
 * グラデーション・影の飾りをやめる（Tailwind のクラスで付いているもの）
 * ========================================================= */
html body .page-container [class*="bg-gradient-to-"] { background-image: none !important; }
html body .page-container [class*="shadow-lg"],
html body .page-container [class*="shadow-xl"],
html body .page-container [class*="shadow-md"] { box-shadow: none !important; }

/* =========================================================
 * ダッシュボードのカレンダー: 1マスを低く
 * ========================================================= */
html body .calendar-grid { border-radius: 6px; }
html body .calendar-day { min-height: 62px; padding: 3px 5px; gap: 2px; }
html body .calendar-day.today { background: #f6f3ec; }
html body .calendar-day .day-event { padding: 1px 4px; border-radius: 2px; }

/* =========================================================
 * 更新詳細: 頭の紺の帯・賃料変更の帯を細く
 * ========================================================= */
html body .head-panel {
  background: #fff !important;
  background-image: none !important;
  color: var(--um-ink) !important;
  border: 1px solid var(--um-line);
  border-radius: 6px !important;
  box-shadow: none !important;
  padding: 10px 14px !important;
  margin-bottom: 10px !important;
}
html body .head-panel .panel-label { color: var(--um-mute); font-size: 11px; margin-bottom: 0; }
html body .head-panel .panel-value { color: var(--um-ink); font-size: 14px; }
html body .head-panel .panel-sub { color: var(--um-sub); font-size: 12px; }
html body .head-panel a { color: var(--um-accent); }
html body .head-panel .btn,
html body .head-panel button { color: var(--um-accent); border-color: var(--um-line-strong); background: #fff; }
html body .change-banner {
  padding: 7px 12px;
  border-radius: 6px;
  background: #f6f3ec;
  border: 1px solid #e4dccb;
  border-left: 3px solid #a07a32;
  margin-bottom: 10px !important;
}
html body .change-banner i { color: #a07a32; font-size: 14px; }

/* 詳細ページのカードどうしの間隔 */
html body .page-container > .card,
html body .page-container > details.card { margin-bottom: 10px !important; }

/* =========================================================
 * インラインで大きな余白が付いた表（空室管理など）を詰める
 * ========================================================= */
html body .page-container table th[style*="padding:10px 14px"],
html body .page-container table th[style*="padding:12px 16px"] { padding: 6px 8px !important; }
html body .page-container table td[style*="padding:12px 14px"],
html body .page-container table td[style*="padding:10px 14px"],
html body .page-container table td[style*="padding:14px 16px"] { padding: 5px 8px !important; }

/* 空室管理: 枠の高さを新しい余白に合わせ、長いメモで列が広がらないように */
html body .vl-page-wrap { height: calc(100vh - 56px - 38px); }
html body .vl-thead-sticky th { background: #f3f4f5; }
html body #vacant-rooms-table td:nth-child(1) { padding: 4px 2px 4px 8px !important; }
html body #vacant-rooms-table td:nth-child(1) > div { width: 44px !important; height: 33px !important; }
html body #vacant-rooms-table td:nth-child(9) { max-width: 170px; }
html body #vacant-rooms-table td:nth-child(9) * { white-space: normal !important; }

/* 更新業務の一覧: 名前・物件名は1行に（狭い列で縦に折れないように） */
html body #renewals-tbody td:nth-child(2) .font-bold,
html body #renewals-tbody td:nth-child(3) > div:first-child { white-space: nowrap; }
html body #renewals-tbody td:nth-child(4) { max-width: 140px; }
/* 名前の横に「賃料変更」「条件同一」の札を並べて1行減らす */
html body #renewals-tbody td:nth-child(2) .font-bold { display: inline-block; margin-right: 6px; }
html body #renewals-tbody td:nth-child(2) > div:first-child { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
/* 現工程は折り返してよい（1行のままだと表が画面からはみ出す） */
html body #renewals-tbody td:nth-child(10) { white-space: normal; min-width: 110px; line-height: 1.3; }
html body #renewals-tbody td:last-child .btn-xs { padding: 3px 6px; }

/* 空室管理: 物件名は1行に */
html body #vacant-rooms-table td:nth-child(2) > div:first-child { white-space: nowrap; }

/* 更新業務の一覧: 長い物件名は「…」で切り、表を画面幅に収める（右の「詳細」ボタンが隠れないように） */
html body #renewals-tbody td:nth-child(3) > div:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
html body #renewals-tbody td { padding-left: 6px; padding-right: 6px; }
html body #renewals-tbody td:nth-child(9) { min-width: 80px !important; }

/* 入居者の一覧: 物件名の列が細くなりすぎないように */
html body #renewals-tbody td:first-child { padding-left: 8px; padding-right: 2px; }

/* 更新詳細「更新時の業務の進めかた」: 「編集」ボタンを区分名の右に並べ、行を低く */
html body .rd-renewal-howto tbody th > div { float: right; margin-left: 6px; }
html body .rd-renewal-howto tbody th .btn-xs { margin-top: 0 !important; padding: 2px 6px; }
html body .rd-renewal-howto th,
html body .rd-renewal-howto td { padding-top: 5px; padding-bottom: 5px; }

/* 更新契約台帳: 書類ボタンを1段に並べる */
html body .ledger-table td.ledger-docs { flex-wrap: nowrap; gap: 4px; }
html body .ledger-table .ledger-doc-btn { margin: 0 2px 0 0 !important; padding: 3px 7px; }

/* =========================================================
 * スマホ（幅767px以下）
 * ========================================================= */
@media (max-width: 767px) {
  html body .page-container { padding: 10px 10px 20px; }
  /* 数字のカードは2列に（1列に4段積むと画面の半分を使ってしまう） */
  html body .page-container > div[style*="minmax(180px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  html body .stat-card { padding: 8px 10px; column-gap: 8px; }
  html body .stat-card .stat-value { font-size: 19px; }
  html body .stat-card .stat-label { font-size: 11.5px; }
  /* 表は横にスクロールさせ、名前・物件名を細い列で縦に折らない */
  html body .data-table td .font-bold,
  html body .data-table td > div:first-child { white-space: nowrap; }
}

/* =========================================================
 * 一覧ページ上の検索の帯: ページの余白（14px 18px）に合わせる
 * ========================================================= */
html body .properties-list-sticky,
html body .residents-list-sticky,
html body .renewals-list-sticky {
  margin: -14px -18px 10px;
  padding: 10px 18px 8px;
  background: var(--um-bg);
  box-shadow: none;
  border-bottom-color: var(--um-line);
}
html body .properties-list-sticky-count,
html body .residents-list-sticky-count,
html body .renewals-list-sticky-count { margin-top: 6px; }

/* =========================================================
 * 入居者管理: 表だけをスクロールさせ、見出し行を固定する
 *   ページ（検索の帯＋表）を画面の高さに収め、表の箱の中でスクロール
 * ========================================================= */
html body .page-container:has(> .residents-list-sticky) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  padding-bottom: 12px;
}
html body .page-container:has(> .residents-list-sticky) > .residents-list-sticky { position: static; flex-shrink: 0; }
html body .page-container:has(> .residents-list-sticky) > .card:has(.residents-table) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  overflow: hidden;
}
html body .residents-table-scroll { flex: 1; min-height: 0; overflow: auto !important; }
html body .residents-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef0f2;
  box-shadow: inset 0 -1px 0 var(--um-line-strong);
}
/* 1行を低く・読みやすく */
html body .residents-table td { padding-top: 6px; padding-bottom: 6px; }
html body .residents-table tbody tr:nth-child(even) { background: #fafbfb; }
html body .residents-table tbody tr:hover { background: var(--um-accent-soft); }
html body .residents-table td .font-bold { font-weight: 600; white-space: nowrap; }
html body .residents-table td:nth-child(1) > div[style*="font-size:11px"],
html body .residents-table td:nth-child(2) > div[style*="font-size:11px"] { font-size: 10.5px !important; white-space: nowrap; }
html body .residents-table .rs-same { color: var(--um-mute); font-size: 12px; }
html body .residents-table td:nth-child(4) > div:first-child { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
html body .residents-table td:nth-child(4) > div:nth-child(2) { white-space: nowrap; }
html body .residents-table td:nth-child(5) > div { white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
html body .residents-table td:nth-child(6) { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
html body .residents-table th:nth-child(6) { text-align: right; }
html body .residents-table .rs-period { color: var(--um-sub); font-variant-numeric: tabular-nums; }

/* 入居者管理: 表を画面幅に収める（右の賃料・契約期間・詳細が隠れないように）。長い名前は「…」で切る */
html body .residents-table td,
html body .residents-table th { padding-left: 6px; padding-right: 6px; }
html body .residents-table td:nth-child(1) > div { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
html body .residents-table td:nth-child(2) > div { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
/* 区分の札は縦に2つ（横に並べると列が広がりすぎる） */
html body .residents-table td:nth-child(3) > div { flex-direction: column !important; gap: 2px !important; }
html body .residents-table td:nth-child(3) .badge { white-space: nowrap; }
html body .residents-table td:nth-child(4) > div:first-child { max-width: 150px; }
html body .residents-table td:nth-child(5) > div { max-width: 120px; }
html body .residents-table .rs-period { font-size: 10.5px !important; letter-spacing: -.01em; }
html body .residents-table td:last-child .btn-xs { padding: 3px 6px; }
/* 「詳細」は行のどこを押しても開くので、ボタンはアイコンだけにして幅を空ける */
html body .residents-table td:last-child .btn-primary.btn-xs { font-size: 0; gap: 0; }
html body .residents-table td:last-child .btn-primary.btn-xs i { font-size: 11px; }
/* スマホ: 元の style.css が表そのものを横スクロールの箱にしていて見出しの固定が効かないため、入居者の表だけ普通の表に戻す（横スクロールは外の箱でする） */
html body .data-table.residents-table { display: table; overflow: visible; }
