/* style.css - 共通スタイル */

/* ダッシュボード テーブルソートアイコン */
.sort-icons {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 2px;
  line-height: 1;
  gap: 0;
}
.sort-icon {
  display: block;
  font-size: 1.0rem;
  color: #000000;
  text-decoration: none;
  line-height: 0.7;
  padding: 0;
}
.sort-icon:hover {
  color: #555;
}
.sort-icon.sort-active {
  color: #0008ff;
}

:root {
  --wasabi-color: #b3c8a0;
  --lightblue-color: #aae0fa;
}

/* ボタン（山葵色） */
.btn-wasabi {
  background-color: #7ba23f;
  border-color: #7ba23f;
  color: #fff;
}
.btn-wasabi:hover,
.btn-wasabi:focus,
.btn-wasabi:active {
  background-color: #698e34 !important;
  border-color: #698e34 !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ボタン（キャンセル用グレー） */
.btn-cancel {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #fff !important;
}
.btn-cancel:hover,
.btn-cancel:focus,
.btn-cancel:active {
  background-color: #5a6268 !important;
  border-color: #5a6268 !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* 戻るリンク風ボタンも見やすく */
.btn-back {
  background-color: #7ba23f !important;
  border-color: #7ba23f !important;
  color: #fff !important;
  text-decoration: none !important;
  display: inline-block !important;
}
.btn-back:hover {
  background-color: #698e34 !important;
  border-color: #698e34 !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* ボタン（青系） */
.btn-blue {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
}
.btn-blue:hover,
.btn-blue:focus,
.btn-blue:active {
  background-color: #0066cc !important;
  border-color: #0066cc !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* 表の見出し（山葵色背景） */
.table-header-wasabi th {
  background-color: #b3c8a0 !important;
}

/* 表のセルの背景色（山葵色背景） */
.table-cell-wasabi {
  background-color: var(--wasabi-color) !important;
}

.table-cell-lightblue {
  background-color: var(--lightblue-color) !important;
}

/* 編集不可項目のグレー背景 */
.cell-readonly {
  background-color: #dddddd !important;
}

.form-control-sm-custom {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25 !important;
  height: calc(1.5em + 0.5rem + 2px) !important;
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-block !important;
  max-width: none !important;
}

/* ファイル入力フィールドの幅を制限 */
input[type="file"].form-control-sm-custom {
  width: auto !important;
  min-width: 200px !important;
  max-width: 300px !important;
}

td, th {
  vertical-align: middle !important;
}

/* 画像拡大用オーバーレイ（3画面共通） */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}
.image-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  border: 2px solid #fff;
}
.image-overlay.is-visible {
  display: flex;
}

/* =========================================================
 * ログイン後 共通レイアウト（左サイドバー）
 * フラットデザイン（影なし、境界線＋余白中心）
 * ========================================================= */

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}

.app-sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 12px;
  gap: 12px;
}

.app-sidebar__brand {
  padding: 10px 10px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.app-sidebar__brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #111827;
}

.app-sidebar__brand-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  word-break: break-word;
}

.app-sidebar__nav {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 4px;
}

.app-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidebar__item {
  margin: 0;
  padding: 0;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  border: 1px solid transparent;
}

.app-sidebar__link:hover {
  background: rgba(0, 0, 0, 0.03);
  color: #111827;
}

.app-sidebar__link.is-active {
  background: rgba(123, 162, 63, 0.12);
  border-color: rgba(123, 162, 63, 0.25);
  color: #111827;
}

.app-sidebar__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  flex: 0 0 auto;
}

.app-sidebar__label {
  font-size: 14px;
  line-height: 1.2;
}

.app-sidebar__footer {
  padding: 8px 4px 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-sidebar__link--danger {
  color: #b91c1c;
}

.app-sidebar__link--danger .app-sidebar__icon {
  color: #b91c1c;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.app-content {
  padding: 4px;
}

/* サイドバー開閉（デフォルト閉じる） */
.has-sidebar-collapsed .app-sidebar {
  margin-left: -260px;
  transition: margin-left 0.2s ease-in-out;
}

.app-shell:not(.has-sidebar-collapsed) .app-sidebar {
  margin-left: 0;
  transition: margin-left 0.2s ease-in-out;
}

.app-header {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
}
.app-header + .app-content .btn-back {
  margin-left: 44px;
}

@media (max-width: 991.98px) {
  .app-shell {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .app-sidebar__nav {
    overflow: visible;
  }
  .app-sidebar__list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .app-sidebar__link {
    white-space: nowrap;
  }
}

/* プロフィール上段（施設名等） */
.sheet-profile {
  table-layout: fixed;
}

/* ラベル列の幅を固定（画像の見た目に寄せる） */
.sheet-profile .col-label {
  width: 90px;
}

/* 入力の基本列（施設名、路線名など） */
.sheet-profile .col-input {
  width: 140px;
}

/* 右側に広がる列（管轄の3枠、所在地などに使われる） */
.sheet-profile .col-wide {
  width: auto;
}

/* 管轄のセル内を「上：見出し、下：入力」で縦積み */
.cell-stack {
  padding: 4px 6px !important;
}
.cell-stack__label {
  font-size: 12px;
  line-height: 1.1;
  margin-bottom: 4px;
  white-space: nowrap;
}
.cell-stack__body .input,
.cell-stack__body input,
.cell-stack__body select,
.cell-stack__body textarea {
  width: 100%;
}

/* 右の「調書更新年月日」も高さを揃えやすくする */
.sheet-profile-updated td {
  min-height: 38px;
}
