/* 顧客専用ダッシュボード */
body.nexus-customer #sidebar,
body.nexus-customer #sidebar-overlay,
body.nexus-customer #tech-banner,
body.nexus-customer .sidebar-toggle,
body.nexus-customer .topbar-search-wrap,
body.nexus-customer .topbar {
  display: none !important;
}

body.nexus-customer .layout,
body.nexus-customer .main-content {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

body.nexus-customer #page-customer {
  display: none;
  min-height: 100vh;
  padding: 0;
  color: var(--text-primary, #e8eaef);
  background: var(--bg-base, #1c1f26);
}

body.nexus-customer #page-customer.active {
  display: block !important;
}

/* Carl-bot 風トップナビ */
.cx-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: 56px;
  padding: 0 20px;
  background: var(--bg-panel, #242833);
}

.cx-nav-brand {
  flex-shrink: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--text-primary, #e8eaef);
  text-decoration: none;
  padding: 14px 4px;
}

.cx-nav-brand:hover {
  color: var(--accent-cyan, #2C69FF);
}

.cx-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cx-nav::-webkit-scrollbar {
  display: none;
}

.cx-nav button {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(232, 234, 239, 0.55);
  padding: 18px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cx-nav button:hover {
  color: rgba(232, 234, 239, 0.9);
}

.cx-nav button.active {
  color: var(--text-primary, #e8eaef);
  border-bottom-color: var(--accent-cyan, #2C69FF);
  background: transparent;
  box-shadow: none;
}

.cx-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.cx-userbar {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.cx-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text-primary, #ecf0f8);
  padding: 6px 4px 6px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.cx-user-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cx-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  font-weight: 700;
  font-size: 0.85rem;
}

.cx-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cx-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 200px;
}

.cx-user-greet {
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cx-user-guild {
  font-size: 0.72rem;
  color: rgba(232, 234, 239, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cx-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--bg-panel, #242833);
  border-radius: 12px;
  padding: 6px;
  z-index: 60;
}

.cx-user-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.cx-user-menu button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.cx-user-menu .cx-menu-link {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: inherit;
}

.cx-user-menu .cx-menu-link:hover {
  background: rgba(255, 255, 255, 0.09);
}

.cx-menu-guild-list {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.cx-menu-guild-item {
  font-size: 0.88rem !important;
  opacity: 0.92;
}

.cx-guild-switch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cx-muted {
  color: rgba(232, 234, 239, 0.5);
}

.cx-logout-btn,
#cx-menu-logout {
  color: var(--accent-red, #e85d7a) !important;
}

.cx-panel {
  display: none;
  animation: cxFade 0.22s ease;
}

.cx-panel.active {
  display: block;
}

@keyframes cxFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.cx-block {
  margin-bottom: 28px;
}

.cx-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cx-block-title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 234, 239, 0.42);
}

.cx-block-head .cx-block-title {
  margin: 0;
}

.cx-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.cx-next {
  padding: 24px 22px 20px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(99, 102, 241, 0.16), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(148, 163, 255, 0.22);
}

.cx-next h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cx-next .when {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: rgba(232, 234, 239, 0.62);
}

.cx-next .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cx-hubs {
  font-size: 0.84rem;
  color: rgba(232, 234, 239, 0.5);
  margin: 0 0 16px;
}

.cx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.055);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cx-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.cx-item h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.cx-item .meta {
  grid-column: 1;
  font-size: 0.78rem;
  color: rgba(232, 234, 239, 0.48);
}

.cx-item .actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cx-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(232, 234, 239, 0.58);
}

.cx-badge.warn {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.cx-badge.ok {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
}

.cx-empty {
  text-align: center;
  padding: 48px 16px;
  color: rgba(232, 234, 239, 0.45);
  font-size: 0.9rem;
}

.cx-empty-soft {
  text-align: center;
  padding: 20px 12px;
  color: rgba(232, 234, 239, 0.4);
  font-size: 0.86rem;
}

.cx-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cx-cal-head strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cx-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cx-cal-dow {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(232, 234, 239, 0.45);
  padding: 6px 4px;
  font-weight: 650;
}

.cx-cal-cell {
  min-height: 88px;
  aspect-ratio: auto;
  border-radius: 12px;
  border: none;
  background: var(--bg-panel, #242833);
  color: inherit;
  cursor: pointer;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px;
  text-align: left;
  transition: background 0.12s ease;
}

.cx-cal-cell:not(:disabled):hover {
  background: var(--bg-card-hover, #2c3140);
}

.cx-cal-cell:disabled {
  cursor: default;
  opacity: 0.72;
}

.cx-cal-cell.today {
  background: color-mix(in srgb, var(--accent-cyan, #2C69FF) 22%, var(--bg-panel, #242833));
}

.cx-cal-cell.busy {
  background: color-mix(in srgb, var(--accent-orange, #FF8C00) 20%, var(--bg-panel, #242833));
  cursor: default;
}

.cx-cal-cell .d {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.cx-cal-cell .s {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--accent-cyan, #2C69FF);
  line-height: 1.25;
  word-break: break-word;
}

.cx-cal-cell .t {
  font-size: 0.78rem;
  color: rgba(232, 234, 239, 0.78);
  line-height: 1.3;
  word-break: break-word;
}

.cx-cal-cell.is-blank {
  background: transparent;
  cursor: default;
  min-height: 0;
  padding: 0;
  opacity: 1;
}

.cx-cal-cell .dot {
  display: none;
}

.cx-form {
  margin-top: 0;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cx-form label {
  font-size: 0.76rem;
  color: rgba(232, 234, 239, 0.5);
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.cx-form input,
.cx-form textarea,
.cx-select,
.cx-q-label,
.cx-q-opts {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
}

.cx-form input:focus,
.cx-form textarea:focus,
.cx-select:focus,
.cx-q-label:focus,
.cx-q-opts:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.45);
}

.cx-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cx-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cx-q-head label {
  margin: 0;
}

.cx-q-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cx-q-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-logout-btn {
  color: var(--accent-red) !important;
}

.cx-q-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cx-q-type {
  flex: 1;
}

@media (max-width: 640px) {
  .cx-shell {
    padding: 22px 14px 56px;
  }
  .cx-item {
    grid-template-columns: 1fr;
  }
  .cx-item .actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }
  .cx-form-row {
    grid-template-columns: 1fr;
  }
}

/* matte refinement + info hierarchy */
.cx-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.cx-kpi {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 10px 8px;
}
.cx-kpi .v { font-size: 1.05rem; font-weight: 700; }
.cx-kpi .k { font-size: 0.72rem; color: rgba(232,234,239,0.58); }

.cx-item, .cx-form, .cx-next, .cx-q-item, .cx-cal-cell, .cx-kpi, .cx-user-trigger {
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  .cx-navbar {
    flex-wrap: wrap;
    padding: 8px 14px 0;
    gap: 4px 12px;
  }
  .cx-nav {
    order: 3;
    flex: 1 1 100%;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .cx-nav button {
    padding: 12px 10px;
    font-size: 0.82rem;
  }
  .cx-user-meta {
    display: none;
  }
  .cx-kpis { grid-template-columns: 1fr 1fr; }
  .cx-cal-cell { min-height: 72px; padding: 8px; }
  .cx-cal-cell .d { font-size: 0.95rem; }
  .cx-cal-cell .s,
  .cx-cal-cell .t { font-size: 0.7rem; }
}

.cx-form-lead {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}
.cx-form .req { color: var(--accent-red, #e85d7a); }
.cx-form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cx-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.cx-reserve-form { margin-top: 16px; }
@media (max-width: 640px) {
  .cx-form-row-3 { grid-template-columns: 1fr; }
}

/* ===== ホーム刷新 ===== */
.cx-home-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-next-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.cx-next-compact .meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: rgba(232, 234, 239, 0.55);
}

.cx-next-compact .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cx-home-cal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cx-home-cal-head .cx-block-title {
  margin: 0;
}

.cx-home-cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cx-home-cal-head > .btn-primary {
  margin-left: auto;
}

.cx-mini-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: rgba(232, 234, 239, 0.55);
  font-weight: 600;
}

.cx-mini-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cx-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cx-mini-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(232, 234, 239, 0.4);
  padding: 4px 0;
}

.cx-mini-cell {
  min-height: 54px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cx-mini-cell.is-blank {
  background: transparent;
  min-height: 0;
}

.cx-mini-cell.is-today {
  background: rgba(34, 139, 230, 0.16);
}

.cx-mini-cell.is-free .cx-mini-num:not(:disabled) {
  cursor: pointer;
}

.cx-mini-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: rgba(232, 234, 239, 0.85);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: default;
}

.cx-mini-num:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
}

.cx-mini-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 10px;
}

.cx-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: inline-block;
}

.cx-dot.is-mine { background: #12b886; }
.cx-dot.is-other { background: #748ffc; }

i.cx-dot {
  cursor: default;
}

@media (max-width: 640px) {
  .cx-home-cal-head > .btn-primary {
    margin-left: 0;
    width: 100%;
  }
  .cx-mini-cell { min-height: 46px; }
}
