/* ==========================================================================
   NEXUS CRM - Common Stylesheet
   Brand concept: 高級感 / 清潔感 / シンプル / スタイリッシュ / モダン
   ========================================================================== */

:root {
  --nx-black: #0b0c10;
  --nx-black-2: #14161d;
  --nx-black-3: #1c1f29;
  --nx-gold: #c6a664;
  --nx-gold-light: #e2cd9a;
  --nx-red: #c0392b;
  --nx-white: #ffffff;
  --nx-gray-50: #f7f7f8;
  --nx-gray-100: #eceef1;
  --nx-gray-200: #dde1e6;
  --nx-gray-300: #c3c9d1;
  --nx-gray-500: #7c8291;
  --nx-gray-700: #4a4f5b;
  --nx-green: #1f9d63;
  --nx-yellow: #d4a017;
  --nx-red-alert: #d64545;
  --nx-radius: 14px;
  --nx-radius-sm: 8px;
  --nx-shadow: 0 4px 20px rgba(0,0,0,0.06);
  --nx-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--nx-gray-50);
  color: var(--nx-black);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.brand-font { font-family: 'Cormorant Garamond', 'Noto Serif JP', serif; letter-spacing: 0.04em; }

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

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--nx-black) 0%, #050506 100%);
  color: var(--nx-gray-300);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 26px 22px 18px;
  border-bottom: 1px solid rgba(198,166,100,0.18);
}
.sidebar-logo .mark {
  font-size: 26px;
  color: var(--nx-gold);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.sidebar-logo .sub {
  font-size: 10px;
  color: var(--nx-gray-500);
  letter-spacing: 0.18em;
  margin-top: 2px;
}
.sidebar-user {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user .info .name { font-size: 13px; color: #fff; font-weight: 600; }
.sidebar-user .info .role { font-size: 11px; color: var(--nx-gold); margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav .nav-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--nx-gray-700); padding: 14px 10px 6px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; color: var(--nx-gray-300);
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a i { width: 18px; text-align: center; color: var(--nx-gray-500); font-size: 14px; }
.sidebar-nav a:hover { background: rgba(198,166,100,0.08); color: #fff; }
.sidebar-nav a.active { background: rgba(198,166,100,0.15); color: var(--nx-gold-light); }
.sidebar-nav a.active i { color: var(--nx-gold); }

.sidebar-footer { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 10px; }
.logout-link { font-size: 12px; color: var(--nx-gray-500); display: flex; align-items: center; gap: 8px; }
.logout-link:hover { color: var(--nx-red); }
.logout-link.active { color: var(--nx-gold-light); }

.main-area { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--nx-gray-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.topbar .topbar-right { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--nx-black); }

.page-content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- Cards & grid ---------- */
.card {
  background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow);
  border: 1px solid var(--nx-gray-100);
  padding: 20px;
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--nx-black); margin: 0 0 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .tag { font-size: 11px; color: var(--nx-gray-500); font-weight: 400; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
}

/* KPI cards */
.kpi-card {
  background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow);
  border: 1px solid var(--nx-gray-100);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi-card .kpi-label { font-size: 11.5px; color: var(--nx-gray-500); font-weight: 600; letter-spacing: 0.02em; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; color: var(--nx-black); line-height: 1.1; }
.kpi-card .kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--nx-gray-500); margin-left: 3px; }
.kpi-card .kpi-sub { font-size: 11.5px; margin-top: 8px; color: var(--nx-gray-500); }
.kpi-card .kpi-sub.up { color: var(--nx-green); }
.kpi-card .kpi-sub.down { color: var(--nx-red-alert); }
.kpi-card .kpi-accent { position: absolute; top:0; left:0; width:4px; height:100%; background: var(--nx-gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; transition: all 0.15s;
}
.btn-primary { background: var(--nx-black); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-gold { background: var(--nx-gold); color: #1a1a1a; }
.btn-gold:hover { background: var(--nx-gold-light); }
.btn-outline { background: #fff; border-color: var(--nx-gray-200); color: var(--nx-black); }
.btn-outline:hover { border-color: var(--nx-black); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: var(--nx-red-alert); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--nx-radius); border: 1px solid var(--nx-gray-100); background: #fff; }
table.nx-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
table.nx-table th {
  text-align: left; padding: 12px 14px; background: var(--nx-gray-50);
  font-size: 11.5px; color: var(--nx-gray-700); font-weight: 700; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--nx-gray-100); white-space: nowrap;
  position: sticky; top: 0;
}
table.nx-table td { padding: 12px 14px; border-bottom: 1px solid var(--nx-gray-100); white-space: nowrap; }
table.nx-table tbody tr:hover { background: var(--nx-gray-50); cursor: pointer; }
table.nx-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge-gray { background: var(--nx-gray-100); color: var(--nx-gray-700); }
.badge-gold { background: rgba(198,166,100,0.15); color: #8a6d2f; }
.badge-green { background: rgba(31,157,99,0.12); color: var(--nx-green); }
.badge-red { background: rgba(214,69,69,0.12); color: var(--nx-red-alert); }
.badge-yellow { background: rgba(212,160,23,0.14); color: #9c7a13; }
.badge-black { background: var(--nx-black); color: #fff; }
.badge-purple { background: rgba(142,68,173,0.14); color: #8e44ad; }

.risk-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; }
.risk-low { background: var(--nx-green); }
.risk-middle { background: var(--nx-yellow); }
.risk-high { background: var(--nx-red-alert); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--nx-gray-700); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--nx-gray-200); border-radius: 9px;
  font-size: 13.5px; background: #fff; color: var(--nx-black);
}
.form-control:focus { outline: none; border-color: var(--nx-gold); box-shadow: 0 0 0 3px rgba(198,166,100,0.15); }
textarea.form-control { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-chip {
  border: 1px solid var(--nx-gray-200); border-radius: 999px; padding: 6px 14px; font-size: 12.5px;
  cursor: pointer; user-select: none; transition: all 0.15s;
}
.checkbox-chip.checked { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--nx-gray-200); overflow-x: auto; margin-bottom: 20px; }
.tab-btn {
  padding: 12px 18px; font-size: 13.5px; font-weight: 600; color: var(--nx-gray-500);
  border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn.active { color: var(--nx-black); border-bottom-color: var(--nx-gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Progress bar ---------- */
.progress-bar-track { width: 100%; height: 8px; background: var(--nx-gray-100); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--nx-gold), var(--nx-gold-light)); border-radius: 999px; transition: width 0.3s; }
.progress-bar-fill.danger { background: linear-gradient(90deg, var(--nx-red-alert), #e57373); }
.progress-bar-fill.warn { background: linear-gradient(90deg, var(--nx-yellow), #f0c14b); }

/* ---------- Body progress ---------- */
.progress-hero {
  background: linear-gradient(135deg, var(--nx-black) 0%, #262a35 100%);
  border-radius: var(--nx-radius); padding: 24px; color: #fff; margin-bottom: 20px;
}
.progress-hero .hero-title { font-size: 13px; letter-spacing: 0.12em; color: var(--nx-gold); font-weight: 700; margin-bottom: 16px; text-transform: uppercase; }
.bp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 900px) { .bp-grid { grid-template-columns: repeat(2, 1fr); } }
.bp-item .bp-label { font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
.bp-item .bp-value { font-size: 15px; font-weight: 700; }
.bp-item .bp-change { font-size: 12.5px; margin-top: 4px; font-weight: 700; }
.bp-item .bp-change.down { color: #7ed6a5; }
.bp-item .bp-change.up { color: #ff8a8a; }

/* ---------- Customer photos tab (body progress photos) ---------- */
.cp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.cp-photo-card {
  background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow);
  border: 1px solid var(--nx-gray-100); overflow: hidden; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s;
}
.cp-photo-card:hover { box-shadow: var(--nx-shadow-lg); transform: translateY(-2px); }
.cp-photo-thumb-wrap { position: relative; width: 100%; aspect-ratio: 3/4; background: var(--nx-gray-100); overflow: hidden; }
.cp-photo-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-photo-cat-badge { position: absolute; top: 8px; left: 8px; }
.cp-photo-meta { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Customer header ---------- */
.customer-header {
  background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow);
  border: 1px solid var(--nx-gray-100); padding: 22px 24px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.customer-header .ch-left { display: flex; align-items: center; gap: 16px; }
.customer-header .ch-avatar {
  width: 58px; height: 58px; border-radius: 50%; background: var(--nx-black); color: var(--nx-gold);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.customer-header h2 { margin: 0 0 4px; font-size: 20px; }
.customer-header .ch-meta { font-size: 12.5px; color: var(--nx-gray-500); display: flex; gap: 14px; flex-wrap: wrap; }
.ch-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.ch-stats .stat-label { font-size: 11px; color: var(--nx-gray-500); }
.ch-stats .stat-value { font-size: 15px; font-weight: 700; margin-top: 2px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--nx-gray-500); }
.empty-state i { font-size: 30px; margin-bottom: 10px; color: var(--nx-gray-300); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1c1f29 0%, #050506 70%);
  padding: 20px;
}
.login-card { width: 100%; max-width: 460px; background: #12141b; border-radius: 18px; padding: 40px 36px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); border: 1px solid rgba(198,166,100,0.2); }
.login-card .logo { text-align: center; margin-bottom: 8px; font-size: 34px; color: var(--nx-gold); font-weight: 700; letter-spacing: 0.14em; }
.login-card .tagline { text-align: center; color: var(--nx-gray-500); font-size: 12px; letter-spacing: 0.1em; margin-bottom: 32px; }
.login-card label { color: var(--nx-gray-300); }
.login-role-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.login-role-btn {
  padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.03);
  color: var(--nx-gray-300); font-size: 12.5px; font-weight: 600; text-align: center;
}
.login-role-btn.active { border-color: var(--nx-gold); background: rgba(198,166,100,0.14); color: var(--nx-gold-light); }
.staff-select-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.staff-select-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); color: #eee;
}
.staff-select-item:hover { border-color: var(--nx-gold); background: rgba(198,166,100,0.08); }
.staff-select-item .avatar { width: 30px; height: 30px; border-radius: 50%; display:flex;align-items:center;justify-content:center; font-size:12px; font-weight:700; color:#fff; flex-shrink:0;}
.staff-select-item .meta { font-size: 11px; color: var(--nx-gray-500); }

/* ---------- Action list (dashboard) ---------- */
.action-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--nx-gray-100);
  margin-bottom: 8px; background: #fff; transition: box-shadow 0.15s;
}
.action-list-item:hover { box-shadow: var(--nx-shadow); }
.action-list-item .ali-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.action-list-item .ali-icon {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.action-list-item .ali-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.action-list-item .ali-sub { font-size: 11.5px; color: var(--nx-gray-500); }

/* ---------- Session input steps (mobile-first) ---------- */
.step-card { background: #fff; border-radius: var(--nx-radius); border: 1px solid var(--nx-gray-100); padding: 18px; margin-bottom: 16px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--nx-black); color: var(--nx-gold); font-size: 12px; font-weight: 700; margin-right: 8px;
}
.exercise-row { border: 1px solid var(--nx-gray-100); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--nx-gray-50); }
.exercise-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.compare-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.compare-up { background: rgba(31,157,99,0.12); color: var(--nx-green); }
.compare-down { background: rgba(214,69,69,0.12); color: var(--nx-red-alert); }
.compare-flat { background: var(--nx-gray-100); color: var(--nx-gray-700); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-20 { gap: 20px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; } .mb-20 { margin-bottom: 20px; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11px; }
.text-gray { color: var(--nx-gray-500); }
.text-gold { color: #8a6d2f; }
.text-bold { font-weight: 700; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-bar select, .filter-bar input { padding: 9px 12px; border: 1px solid var(--nx-gray-200); border-radius: 9px; font-size: 13px; background: #fff; }
.section-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.section-sub { font-size: 12.5px; color: var(--nx-gray-500); margin: 0 0 20px; }
.chart-toolbar { display: flex; gap: 6px; margin-bottom: 14px; }
.chart-toolbar button {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--nx-gray-200); background: #fff; font-size: 12px; font-weight: 600; color: var(--nx-gray-700);
}
.chart-toolbar button.active { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }

/* ---------- Area management summary hero (⑤-2 売上・会員数の見やすさ改善) ---------- */
.area-summary-hero {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: linear-gradient(135deg, var(--nx-black) 0%, #1c1f29 100%);
  border-radius: var(--nx-radius); padding: 20px 22px;
}
.area-summary-hero .ash-item { color: #fff; }
.area-summary-hero .ash-label { font-size: 12px; color: var(--nx-gold-light); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.area-summary-hero .ash-value { font-size: 24px; font-weight: 800; }
.area-summary-hero .ash-value .ash-unit { font-size: 13px; font-weight: 600; color: var(--nx-gray-300); margin-left: 3px; }
@media (max-width: 760px) {
  .area-summary-hero { grid-template-columns: 1fr 1fr; }
}

/* ---------- Reservations: name search / autocomplete ---------- */
.rv-search-wrap { position: relative; }
.rv-search-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid var(--nx-gray-200); border-radius: 10px;
  box-shadow: var(--nx-shadow-lg); max-height: 240px; overflow-y: auto; margin-top: 4px; display: none;
}
.rv-search-results.open { display: block; }
.rv-search-item { padding: 10px 14px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rv-search-item:hover { background: var(--nx-gray-50); }
.rv-search-item .rv-search-item-sub { font-size: 11px; color: var(--nx-gray-500); }
.rv-search-empty { padding: 10px 14px; font-size: 12.5px; color: var(--nx-gray-500); }
.rv-selected-customer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--nx-gray-50); border: 1px solid var(--nx-gray-200); border-radius: 9px; padding: 9px 12px; margin-top: 6px;
}
.rv-selected-customer .clear-btn { color: var(--nx-gray-500); cursor: pointer; }

/* ---------- Reservations: recurrence toggle ---------- */
.rv-recur-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-recur-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--nx-gray-200); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--nx-gray-700); display: flex; align-items: center; gap: 6px;
}
.rv-recur-btn.active { background: var(--nx-gold); color: #fff; border-color: var(--nx-gold); }
.rv-recur-count { width: 70px; }

/* ---------- Reservations: day timeline (calendar style like phone app) ---------- */
.rv-timeline-wrap { display: flex; gap: 0; background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow); overflow: hidden; }
.rv-timeline-hours { width: 56px; flex-shrink: 0; border-right: 1px solid var(--nx-gray-100); position: relative; background: var(--nx-gray-50); }
.rv-timeline-hour-label {
  position: absolute; left: 0; right: 0; font-size: 11px; color: var(--nx-gray-500);
  text-align: center; transform: translateY(-50%); padding-top: 2px;
}
.rv-timeline-tracks { flex: 1; display: flex; overflow-x: auto; }
.rv-timeline-track { flex: 1; min-width: 220px; position: relative; border-right: 1px solid var(--nx-gray-100); }
.rv-timeline-track:last-child { border-right: none; }
.rv-timeline-track-header {
  position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--nx-gray-100);
  padding: 10px 12px; font-size: 12.5px; font-weight: 700; text-align: center;
}
.rv-timeline-grid { position: relative; }
.rv-timeline-hline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--nx-gray-100); }
.rv-timeline-block {
  position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 6px 10px; overflow: hidden;
  background: var(--nx-gold); color: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.rv-timeline-block.status-来店済 { background: var(--nx-green); }
.rv-timeline-block.status-キャンセル, .rv-timeline-block.status-無断キャンセル { background: var(--nx-gray-500); opacity: 0.75; }
.rv-timeline-block .rv-tb-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-timeline-block .rv-tb-meta { font-size: 10.5px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-timeline-nowline { position: absolute; left: 0; right: 0; border-top: 2px solid var(--nx-red-alert); z-index: 4; }
.rv-timeline-nowline::before {
  content: ''; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--nx-red-alert);
}

/* ---------- Reservations: multi-store checkbox picker ---------- */
.rv-store-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-store-chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--nx-gray-200); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--nx-gray-700); cursor: pointer; user-select: none;
}
.rv-store-chip.active { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }

/* ---------- Reservations: view toggle (list / timeline) ---------- */
.rv-view-toggle { display: flex; gap: 6px; }
.rv-view-toggle button {
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--nx-gray-200); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--nx-gray-700);
}
.rv-view-toggle button.active { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }

/* ---------- Public booking page (book.html) ---------- */
.book-page { min-height: 100vh; background: var(--nx-gray-50); }
.book-header {
  background: linear-gradient(135deg, var(--nx-black) 0%, #1c1f29 100%); color: #fff;
  padding: 26px 20px; text-align: center;
}
.book-header .mark { font-size: 26px; font-weight: 700; color: var(--nx-gold); letter-spacing: 0.1em; }
.book-header .sub { font-size: 12px; color: var(--nx-gray-300); letter-spacing: 0.1em; margin-top: 4px; }
.book-wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }
.book-steps { display: flex; justify-content: space-between; margin-bottom: 22px; gap: 6px; }
.book-step {
  flex: 1; text-align: center; font-size: 11px; font-weight: 700; color: var(--nx-gray-500);
  padding-bottom: 10px; border-bottom: 3px solid var(--nx-gray-200);
}
.book-step.active { color: var(--nx-black); border-color: var(--nx-gold); }
.book-step.done { color: var(--nx-green); border-color: var(--nx-green); }
.book-card { background: #fff; border-radius: var(--nx-radius); box-shadow: var(--nx-shadow); padding: 22px; margin-bottom: 16px; }
.book-store-option, .book-menu-option, .book-plan-option, .book-trainer-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--nx-gray-200); border-radius: 12px; padding: 13px 16px; margin-bottom: 10px; cursor: pointer;
}
.book-store-option.selected, .book-menu-option.selected, .book-plan-option.selected, .book-trainer-option.selected {
  border-color: var(--nx-gold); background: rgba(198,166,100,0.06);
}
.book-slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.book-slot {
  padding: 10px 6px; text-align: center; border: 1.5px solid var(--nx-gray-200); border-radius: 9px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; background: #fff;
}
.book-slot.selected { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }
.book-slot.disabled { color: var(--nx-gray-300); background: var(--nx-gray-50); cursor: not-allowed; text-decoration: line-through; }
.book-confirm-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--nx-gray-100); font-size: 13.5px; }
.book-confirm-row:last-child { border-bottom: none; }
.book-success { text-align: center; padding: 30px 10px; }
.book-success i { font-size: 48px; color: var(--nx-green); margin-bottom: 14px; }
@media (max-width: 480px) {
  .book-slot-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Public booking page: calendar-style date/time picker (Step 3) ---------- */
.book-cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.book-cal-month { font-size: 14px; font-weight: 700; }
.book-cal-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--nx-gray-200); background: #fff;
  color: var(--nx-gray-700); display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.book-cal-arrow:disabled { color: var(--nx-gray-300); cursor: not-allowed; }
.book-cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.book-cal-day {
  text-align: center; padding: 8px 2px; border-radius: 10px; border: 1.5px solid var(--nx-gray-200);
  cursor: pointer; background: #fff; user-select: none;
}
.book-cal-day.sun .book-cal-wd, .book-cal-day.sun .book-cal-dnum { color: var(--nx-red-alert); }
.book-cal-day.sat .book-cal-wd, .book-cal-day.sat .book-cal-dnum { color: #2f6fd6; }
.book-cal-day .book-cal-wd { font-size: 10.5px; color: var(--nx-gray-500); margin-bottom: 3px; }
.book-cal-day .book-cal-dnum { font-size: 15px; font-weight: 700; }
.book-cal-day.selected { background: var(--nx-black); border-color: var(--nx-black); }
.book-cal-day.selected .book-cal-wd, .book-cal-day.selected .book-cal-dnum { color: #fff; }
.book-cal-day.disabled { opacity: 0.35; cursor: not-allowed; }

.book-timeline-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--nx-gray-500); margin-bottom: 10px; }
.book-timeline-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.book-timeline-legend .dot-free { background: #fff; border: 1.5px solid var(--nx-gray-200); }
.book-timeline-legend .dot-busy { background: var(--nx-gray-300); }
.book-timeline-legend .dot-selected { background: var(--nx-gold); }

.book-timeline-wrap {
  display: flex; gap: 0; border: 1px solid var(--nx-gray-100); border-radius: 12px; overflow: hidden; max-height: 460px; overflow-y: auto;
}
.book-tl-hours { width: 48px; flex-shrink: 0; position: relative; background: var(--nx-gray-50); border-right: 1px solid var(--nx-gray-100); }
.book-tl-hour-label {
  position: absolute; left: 0; right: 0; font-size: 10.5px; color: var(--nx-gray-500); text-align: center; transform: translateY(-50%);
}
.book-tl-grid { flex: 1; position: relative; }
.book-tl-hline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--nx-gray-100); }
.book-tl-busy {
  position: absolute; left: 4px; right: 4px; background: repeating-linear-gradient(45deg, var(--nx-gray-200), var(--nx-gray-200) 6px, var(--nx-gray-100) 6px, var(--nx-gray-100) 12px);
  border-radius: 6px; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.book-tl-busy span { font-size: 10.5px; color: var(--nx-gray-500); font-weight: 600; background: rgba(255,255,255,0.7); padding: 1px 6px; border-radius: 4px; }
.book-tl-cell {
  position: absolute; left: 4px; right: 4px; border-radius: 6px; cursor: pointer; z-index: 2;
  border: 1.5px dashed var(--nx-gray-200); box-sizing: border-box; transition: background 0.15s;
}
.book-tl-cell:hover { background: rgba(198,166,100,0.12); border-color: var(--nx-gold); }
.book-tl-cell.selected { background: var(--nx-gold); border: 1.5px solid var(--nx-gold); }
.book-tl-cell.selected .book-tl-cell-time { color: #fff; }
.book-tl-cell.disabled { cursor: not-allowed; border: none; pointer-events: none; }
.book-tl-cell-time { position: absolute; top: 2px; left: 6px; font-size: 10px; font-weight: 700; color: var(--nx-gray-500); }
@media (max-width: 480px) {
  .book-cal-day { padding: 7px 0; }
  .book-cal-day .book-cal-dnum { font-size: 13px; }
  .book-timeline-wrap { max-height: 400px; }
}

/* ---------- Reservation requests badge / block styling ---------- */
.rv-guest-badge { background: rgba(142,68,173,0.14); color: #8e44ad; }
.rv-timeline-block.block-type { background: var(--nx-gray-700); opacity: 0.9; }
.rv-timeline-block.status-予約リクエスト { background: #8e44ad; }
.rv-timeline-block.status-対応不可 { background: var(--nx-gray-500); opacity: 0.75; text-decoration: line-through; }

/* ---------- Reservations: external request queue ---------- */
.rv-request-card { border: 1.5px solid rgba(142,68,173,0.3); background: rgba(142,68,173,0.04); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.rv-request-card .rv-request-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.rv-request-meta { font-size: 12px; color: var(--nx-gray-500); line-height: 1.7; margin-top: 4px; }
.rv-reminder-card { border: 1.5px solid rgba(212,160,23,0.35); background: rgba(212,160,23,0.05); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,10,14,0.55); display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal-box h3 { margin-top: 0; }
.modal-close { position: absolute; top: 14px; right: 18px; font-size: 20px; color: var(--nx-gray-500); }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--nx-black); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--nx-shadow-lg); z-index: 2000; display: none; align-items: center; gap: 8px;
}
.toast.show { display: flex; }
.toast i { color: var(--nx-gold); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .customer-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .page-content { padding: 16px 14px 50px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 14px; }
  .bp-grid { grid-template-columns: 1fr 1fr; }
  table.nx-table { min-width: 700px; }
  .form-row { flex-direction: column; }
}
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; display: none; }
.sidebar-backdrop.show { display: block; }

/* ---------- Org chart ---------- */
.oc-root-row, .oc-managers-row, .oc-members-row { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.oc-areas-row { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.oc-stores-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.oc-area-block {
  border: 1px dashed var(--nx-gray-300); border-radius: var(--nx-radius); padding: 16px 14px; background: var(--nx-gray-50);
  display: flex; flex-direction: column; align-items: center; min-width: 260px;
}
.oc-area-header { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.oc-store-block {
  border: 1px solid var(--nx-gray-200); border-radius: var(--nx-radius-sm); padding: 12px 10px; background: #fff;
  display: flex; flex-direction: column; align-items: center; min-width: 150px;
}
.oc-store-header { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; white-space: nowrap; }
.oc-connector { width: 2px; height: 18px; background: var(--nx-gray-300); margin: 2px 0; }
.oc-connector-long { height: 24px; }
.oc-card {
  background: #fff; border: 1px solid var(--nx-gray-200); border-radius: var(--nx-radius-sm); padding: 10px 14px;
  text-align: center; min-width: 96px; box-shadow: var(--nx-shadow); transition: transform 0.15s;
}
.oc-card:hover { transform: translateY(-2px); box-shadow: var(--nx-shadow-lg); }
.oc-card.oc-root { border-color: var(--nx-gold); background: var(--nx-black); }
.oc-card.oc-root .oc-name, .oc-card.oc-root .oc-role { color: #fff; }
.oc-card.oc-empty { color: var(--nx-gray-500); font-size: 12px; box-shadow: none; cursor: default; }
.oc-avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; margin: 0 auto 6px;
}
.oc-name { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.oc-role { font-size: 10.5px; color: var(--nx-gray-500); margin-top: 1px; }
.oc-badge { font-size: 9.5px; background: var(--nx-red-alert); color: #fff; border-radius: 999px; padding: 1px 8px; margin-top: 4px; display: inline-block; }
