/* ============================================================
   予約システム 共通スタイル
   Design: Refined Editorial — 深紺 × アイボリー × 琥珀
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;600;700&family=Noto+Sans+JP:wght@300;400;500;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --ink:        #1a1f2e;
  --ink-light:  #3d4460;
  --ivory:      #f8f5ef;
  --ivory-dark: #ede9e0;
  --amber:      #c8882a;
  --amber-light:#e8a84a;
  --teal:       #2a7a7a;
  --teal-light: #3a9a9a;
  --rose:       #c84a4a;
  --sage:       #5a7a5a;
  --white:      #ffffff;
  --shadow-sm:  0 1px 3px rgba(26,31,46,.08);
  --shadow-md:  0 4px 16px rgba(26,31,46,.12);
  --shadow-lg:  0 8px 32px rgba(26,31,46,.16);
  --radius:     8px;
  --radius-lg:  16px;
  --font-serif: 'DM Serif Display', 'Noto Serif JP', serif;
  --font-sans:  'Noto Sans JP', sans-serif;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}

/* ---- Typography ---- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.3; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-light); }

/* ---- Layout ---- */
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.main-content { flex: 1; padding: 40px 0; }

/* ---- Navigation ---- */
.topbar {
  background: var(--ink);
  color: var(--ivory);
  padding: 0 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 60px;
}
.topbar-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ivory);
  letter-spacing: 0.03em;
}
.topbar-brand span { color: var(--amber); }
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-nav a {
  color: rgba(248,245,239,.7);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.topbar-nav a:hover, .topbar-nav a.active {
  background: rgba(255,255,255,.1);
  color: var(--ivory);
}
.topbar-nav .btn-nav-accent {
  background: var(--amber);
  color: var(--ink);
  font-weight: 500;
}
.topbar-nav .btn-nav-accent:hover { background: var(--amber-light); }

/* Sidebar Layout */
.dashboard-layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--ink);
  padding: 24px 0;
  display: flex; flex-direction: column;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(248,245,239,.35);
  padding: 8px 20px 4px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(248,245,239,.65);
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.06);
  color: var(--ivory);
}
.sidebar-nav a.active {
  background: rgba(200,136,42,.1);
  color: var(--amber);
  border-left-color: var(--amber);
}
.sidebar-nav a .nav-icon { width: 18px; text-align: center; opacity: 0.8; }
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user { font-size: 0.82rem; color: rgba(248,245,239,.5); }
.sidebar-user strong { display: block; color: var(--ivory); font-size: 0.9rem; }

.dashboard-main { flex: 1; overflow: auto; background: var(--ivory); }
.dashboard-content { padding: 32px; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,31,46,.06);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ivory-dark);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: var(--font-serif); font-size: 1.1rem; color: var(--ink); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; background: var(--ivory); border-top: 1px solid var(--ivory-dark); }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(26,31,46,.06);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.amber::before { background: var(--amber); }
.stat-card.teal::before  { background: var(--teal); }
.stat-card.rose::before  { background: var(--rose); }
.stat-card.sage::before  { background: var(--sage); }
.stat-number { font-family: var(--font-serif); font-size: 2.4rem; color: var(--ink); line-height: 1; }
.stat-label  { font-size: 0.82rem; color: var(--ink-light); margin-top: 6px; }
.stat-icon   { position: absolute; right: 20px; top: 20px; font-size: 2rem; opacity: 0.12; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: var(--ink-light); color: var(--ivory); }
.btn-amber     { background: var(--amber); color: var(--white); }
.btn-amber:hover { background: var(--amber-light); color: var(--white); }
.btn-teal      { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-light); color: var(--white); }
.btn-danger    { background: var(--rose); color: var(--white); }
.btn-danger:hover { background: #d45c5c; color: var(--white); }
.btn-outline   { background: transparent; border: 1.5px solid var(--ink-light); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--ivory); }
.btn-ghost     { background: transparent; color: var(--ink-light); }
.btn-ghost:hover { background: var(--ivory-dark); color: var(--ink); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.88rem; font-weight: 500;
  color: var(--ink-light); margin-bottom: 6px;
}
.form-label .required { color: var(--rose); margin-left: 4px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--ivory-dark);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,122,122,.12);
}
.form-control.error { border-color: var(--rose); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--ink-light); margin-top: 4px; }
.form-error { font-size: 0.82rem; color: var(--rose); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- Table ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--ivory); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  border-bottom: 2px solid var(--ivory-dark);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(26,31,46,.05);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(248,245,239,.6); }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* ---- Status badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.status-pending   { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.status-no-show   { background: #e2e3e5; color: #383d41; }
.badge-active     { background: #d4edda; color: #155724; }
.badge-pending    { background: #fff3cd; color: #856404; }
.badge-suspended  { background: #f8d7da; color: #721c24; }
.badge-basic      { background: var(--ivory-dark); color: var(--ink-light); }
.badge-standard   { background: #d1ecf1; color: #0c5460; }
.badge-premium    { background: #f3e5d0; color: #8b4513; }

/* ---- Alerts ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  border-left: 4px solid;
}
.alert-success { background: #f0faf0; color: #1a5c2a; border-color: var(--sage); }
.alert-error   { background: #fff5f5; color: #7a1a1a; border-color: var(--rose); }
.alert-warning { background: #fffbf0; color: #7a5c00; border-color: var(--amber); }
.alert-info    { background: #f0f8ff; color: #1a3a5c; border-color: var(--teal); }

/* ---- Page header ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 1.7rem; }
.breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 0.82rem; color: var(--ink-light);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb span::before { content: '/'; margin-right: 8px; opacity: 0.4; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,31,46,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 560px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ivory-dark);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--ivory-dark); display: flex; gap: 10px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-light); line-height: 1; }

/* ---- Calendar/Schedule ---- */
.schedule-grid { display: grid; grid-template-columns: 80px repeat(7, 1fr); gap: 1px; background: var(--ivory-dark); border-radius: var(--radius); overflow: hidden; }
.schedule-header { background: var(--ink); color: var(--ivory); padding: 10px 8px; text-align: center; font-size: 0.82rem; }
.schedule-time { background: var(--ivory); padding: 8px; font-size: 0.78rem; color: var(--ink-light); text-align: right; }
.schedule-cell { background: var(--white); min-height: 40px; position: relative; padding: 2px; }
.schedule-cell:hover { background: rgba(42,122,122,.04); }
.schedule-booking {
  background: var(--teal);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  margin: 1px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Time slot picker ---- */
.time-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.time-slot {
  padding: 10px;
  border: 1.5px solid var(--ivory-dark);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}
.time-slot:hover:not(.disabled) { border-color: var(--teal); background: rgba(42,122,122,.05); }
.time-slot.selected { background: var(--teal); color: white; border-color: var(--teal); }
.time-slot.disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 13px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  border: 1.5px solid var(--ivory-dark);
  background: var(--white);
  color: var(--ink);
  transition: all var(--transition);
}
.pagination a:hover  { border-color: var(--teal); color: var(--teal); }
.pagination .current { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--ink-light); }
.text-amber  { color: var(--amber); }
.text-teal   { color: var(--teal); }
.text-rose   { color: var(--rose); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.fw-bold { font-weight: 700; }
.hidden { display: none; }

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,136,42,.15) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,122,122,.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.login-box {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 460px; max-width: 100%;
  position: relative; z-index: 1;
  backdrop-filter: blur(10px);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo h1 {
  font-family: var(--font-serif);
  color: var(--ivory);
  font-size: 2rem;
}
.login-logo h1 span { color: var(--amber); }
.login-logo p { color: rgba(248,245,239,.5); font-size: 0.85rem; margin-top: 6px; }
.login-box .form-label { color: rgba(248,245,239,.7); }
.login-box .form-control {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: var(--ivory);
}
.login-box .form-control:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200,136,42,.15);
}
.login-box .form-control::placeholder { color: rgba(248,245,239,.3); }

/* ---- Public booking page ---- */
.booking-header {
  background: var(--ink);
  color: var(--ivory);
  padding: 48px 0 40px;
  text-align: center;
}
.booking-header h1 { color: var(--ivory); font-size: 2rem; }
.booking-header p  { color: rgba(248,245,239,.65); margin-top: 8px; }
.booking-steps {
  display: flex; justify-content: center; gap: 0;
  margin: 32px 0 0;
  position: relative;
}
.booking-step {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 32px;
  position: relative; z-index: 1;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: rgba(248,245,239,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
  margin-bottom: 8px;
  border: 2px solid rgba(255,255,255,.15);
}
.step-num.active  { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.step-num.done    { background: var(--teal); color: white; border-color: var(--teal); }
.step-label { font-size: 0.78rem; color: rgba(248,245,239,.5); }
.step-label.active { color: var(--amber); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-content { padding: 20px; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar-nav a { padding: 8px 8px; font-size: 0.82rem; }
}
