/* shared.css — Reserve / Biz 共通の骨子スタイル。
   アプリ固有の色・レイアウトは reserve.css / biz.css で上書きする。 */

/* ============ デザイントークン（共通デフォルト） ============ */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #ecfdf5;
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --radius: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 40px -15px rgba(16, 185, 129, 0.15), 0 4px 12px rgba(0,0,0,0.05);
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/* ============ リセット ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ Body ============ */
body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ============ サイドバー ============ */
aside {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  flex-shrink: 0;
  z-index: 10;
}

aside .logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  color: var(--primary);
  padding: 0 12px;
  display: flex;
  align-items: center;
}

/* ロゴ先頭のドット（ブランド色） */
aside .logo::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
}

aside nav ul {
  list-style: none;
}

aside nav li {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}

aside nav li:hover {
  background: var(--primary-light);
  color: var(--primary);
}

aside nav li.active {
  background: var(--primary);
  color: white;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 0 12px;
}

/* 管理者モードバナー（admin ロール時にサイドバーへ表示） */
.admin-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 20px;
  padding: 9px 12px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ============ カード ============ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h2 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

/* ============ テーブル ============ */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
}

td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

/* ============ フォーム ============ */
input, select, textarea {
  font-family: var(--font-body);
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  font-size: 14px;
  transition: all 0.2s;
  color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ============ ボタン ============ */
button {
  font-family: var(--font-body);
  background: var(--primary);
  color: white;
  border: 1px solid transparent;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  background: var(--primary-hover);
}

button.secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--bg-main);
  border-color: var(--primary);
  color: var(--primary);
}

/* ============ バッジ ============ */
.badge {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-error   { background: var(--error-bg);   color: var(--error-text); }

/* ロールバッジ（権限を一目で識別） */
.badge-admin {
  background: #4338ca;
  color: white;
  border: 1px solid #3730a3;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(67,56,202,.30);
}

.badge-owner {
  background: #d97706;
  color: white;
  border: 1px solid #b45309;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(217,119,6,.30);
}

.badge-tenant {
  background: #16a34a;
  color: white;
  border: 1px solid #15803d;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(22,163,74,.25);
}

/* ============ モーダル ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: white;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

/* ============ セクション表示制御 ============ */
.content-section {
  display: none;
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-section.active {
  display: block;
}

.hidden {
  display: none !important;
}

/* ============ アニメーション ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}

/* ============ レスポンシブ ============ */
@media (max-width: 900px) {
  aside {
    width: 180px;
    padding: 24px 10px;
  }
  aside nav li {
    font-size: 13px;
    padding: 10px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 600px) {
  body { overflow: hidden; }

  aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 200;
    padding: 24px 16px;
  }

  aside.open {
    transform: translateX(0);
  }

  aside nav li {
    font-size: 14px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
