/* biz.css — Biz 管理画面固有スタイル。
   shared.css の後に読み込む。深緑テーマで shared.css のトークンを上書きする。 */

/* ============ Biz 固有トークン（深緑テーマ） ============ */
:root {
  --primary:       #3f6b52;
  --primary-hover: #2f5340;
  --primary-light: #e7f0ea;
  --bg-main:       #f4f6f4;
  --bg-sidebar:    #ffffff;
  --card-bg:       rgba(255, 255, 255, 0.85);
  --text-main:     #2a322c;
  --text-muted:    #7b857e;
  --border:        #e2e8e3;
  --error-text:    #b4524a;
  --error-bg:      #fdecea;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.03);
  --font-heading:  'Outfit', 'Noto Sans JP', sans-serif;
  --font-body:     'Noto Sans JP', sans-serif;
  /* Biz 固有 */
  --green:         #3f6b52;
  --green-dark:    #2f5340;
  --danger:        #b4524a;
  --muted:         #7b857e;
  /* Biz HTMLの inline style との互換（--bg, --card, --text は旧変数名） */
  --bg:            #f4f6f4;
  --card:          #ffffff;
  --text:          #2a322c;
}

/* ============ Body（Reserve と同じ淡いグラデ・緑寄り） ============ */
body {
  font-size: 15px;
  background: radial-gradient(circle at 10% 20%, rgba(231, 240, 234, 0.5) 0%, rgba(244, 246, 244, 1) 90%);
}

/* ============ 見出し ============ */
h1, h2 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ============ サイドバー（Biz 独自・色のみ上書き、余白は shared 準拠） ============ */
aside .logo {
  color: var(--green-dark);
}

/* ロール/テナント名バッジ（サイドバー内） */
.admin-badge {
  font-size: 12px;
  color: var(--green);
  background: #e7f0ea;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 4px 12px 16px;
  display: inline-block;
}

aside nav li {
  border-radius: 10px;
  transition: all .15s ease;
}

aside nav li:hover {
  background: #e7f0ea;
  color: var(--green-dark);
}

aside nav li.active {
  background: var(--green);
}

/* ============ メインコンテンツ ============ */
#appView {
  flex: 1;
  overflow-y: auto;
}

main { margin: 0; padding: 0 52px 48px; }

/* ============ ヘッダー（Reserve 同様：タイトルなし、バッジのみ） ============ */
#appHeader {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 48px 52px 0;
  margin-bottom: 36px;
}

#sidebarToggleInner {
  display: none;
  margin-right: auto;
}

/* ============ フォーム（Biz 上書き） ============ */
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 4px;
}

input[type=text], input[type=password] {
  padding: 10px 14px;
  border-radius: 12px;
  background: white;
}

select {
  padding: 10px 14px;
  border-radius: 12px;
  background: white;
}

input:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 107, 82, 0.15);
}

/* ============ ボタン（Biz 上書き・深緑グロー） ============ */
button {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(63, 107, 82, 0.18);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.ghost:hover {
  background: #e7f0ea;
  color: var(--green-dark);
  transform: none;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.danger:hover {
  background: #fdecea;
  transform: none;
}

/* ============ テーブル（Biz 上書き） ============ */
.inactive td { opacity: .5; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }

/* ============ ロールバッジ（Biz はパステル調） ============ */
.badge-admin  { background: #e0e7ff !important; color: #3730a3 !important; box-shadow: none; border: none; font-size: 12px; padding: 4px 10px; }
.badge-owner  { background: #fef3c7 !important; color: #92400e !important; box-shadow: none; border: none; font-size: 12px; padding: 4px 10px; }
.badge-tenant { background: #e7f0ea !important; color: var(--green) !important; box-shadow: none; border: none; font-size: 12px; padding: 4px 10px; }

/* ============ モーダル（Biz 上書き） ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay.hidden { display: none; }

.modal {
  border-radius: 14px;
  padding: 24px;
  max-width: 380px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.modal h2 {
  color: var(--green-dark);
  margin-bottom: 0;
}

.modal-note   { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { width: auto; flex: 1; }

/* ============ リンクボタン ============ */
.link-btn {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  box-shadow: none;
}

.link-btn:hover {
  background: #e7f0ea;
  transform: none;
}

/* ============ メッセージ ============ */
.msg     { font-size: 13px; margin-top: 8px; }
.msg.err { color: var(--danger); }

/* ============ ハンバーガーボタン ============ */
#sidebarToggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 250;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  box-shadow: none;
}

#sidebarOverlay { display: none; }

/* ============ ログイン画面 ============ */
#loginView {
  background: radial-gradient(circle at 30% 20%, rgba(231, 240, 234, 0.6) 0%, rgba(244, 246, 244, 1) 80%);
}

/* タブセレクターのアクティブボタンに影 */
.login-tab {
  box-shadow: none;
  transition: all 0.15s ease;
}

.login-tab[style*="background:var(--card)"],
.login-tab[style*="background: var(--card)"] {
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ============ レスポンシブ（Biz 固有） ============ */
@media (max-width: 900px) {
  main { padding: 0 16px 24px; }
  #appHeader { padding: 24px 16px 0; margin-bottom: 16px; }
  #loginView > div { max-width: 90vw !important; padding: 32px 24px !important; }
}

@media (max-width: 600px) {
  #sidebarToggle:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #sidebarOverlay:not(.hidden) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.4);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  #sidebarOverlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  #sidebarToggleInner:not(.hidden) { display: flex; align-items: center; justify-content: center; }

  /* テーブル→カード化 */
  table.responsive-table thead { display: none; }
  table.responsive-table,
  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td { display: block; width: 100%; }

  table.responsive-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
  }

  table.responsive-table td {
    border-bottom: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
  }

  table.responsive-table td:not([data-label])::before { content: none; }
}
