/* ============================================
   Salon Lumière — 管理画面スタイル
   配色: 白基調 ＋ チャコール × ディープグリーン
   ============================================ */

:root {
  --ink: #2b2925;
  --ink-soft: #5c574f;
  --muted: #8c867c;
  --bg: #f4f3f0;
  --surface: #ffffff;
  --line: #e3e0da;
  --dark: #2b2723;
  --dark-soft: #3a352f;
  --green: #2f6f4f;
  --green-dark: #26593f;
  --green-pale: #e9f2ed;
  --gold: #b08d57;
  --red: #b3452e;
  --red-pale: #faeae5;
  --serif: 'Shippori Mincho', serif;
  --sans: 'Noto Sans JP', sans-serif;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); }

/* ---- レイアウト ---- */
body.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--dark);
  color: #cfc8bc;
  display: flex;
  flex-direction: column;
}
.sidebar-brand { padding: 22px 20px 18px; border-bottom: 1px solid #3d3831; }
.sidebar-shop { display: block; font-family: var(--serif); font-size: 18px; color: #f6f1e8; letter-spacing: 0.05em; }
.sidebar-label { font-size: 11px; letter-spacing: 0.15em; color: #8d8172; }
.sidebar-nav { padding: 14px 0; flex: 1; }
.sidebar-nav a {
  display: block;
  padding: 11px 20px;
  color: #cfc8bc;
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--dark-soft); color: #fff; }
.sidebar-nav a.is-active { background: var(--dark-soft); color: #fff; border-left-color: var(--gold); }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid #3d3831; }
.sidebar-foot a { color: #8d8172; font-size: 12px; text-decoration: none; }
.sidebar-foot a:hover { color: #cfc8bc; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: 0.05em; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-soft); }
.btn-link { background: none; border: none; color: var(--green); font-family: var(--sans); font-size: 13px; cursor: pointer; text-decoration: underline; }

.admin-content { padding: 26px 28px 60px; max-width: 1160px; width: 100%; }

/* ---- 共通部品 ---- */
.flash { margin-bottom: 18px; padding: 11px 16px; border-radius: 4px; font-size: 13.5px; }
.flash-success { background: var(--green-pale); color: var(--green-dark); border: 1px solid #c8ddd1; }
.flash-error { background: var(--red-pale); color: var(--red); border: 1px solid #eac6bb; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-soft);
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs { padding: 2px 10px; font-size: 12px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-pale); }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.b-confirmed { background: var(--green-pale); color: var(--green-dark); }
.b-done { background: #eceae6; color: var(--ink-soft); }
.b-cancelled { background: var(--red-pale); color: var(--red); }
.b-inactive { background: #eceae6; color: var(--muted); }

/* ---- 統計カード ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 22px;
}
.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.stat-value span { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat-value-sm { font-size: 24px; padding-top: 6px; }

/* ---- パネル ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 22px;
}
.panel-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.04em; }
.panel-sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.panel-empty { color: var(--muted); font-size: 13.5px; padding: 18px 0; text-align: center; }
.panel-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---- タイムライン・リスト ---- */
.timeline, .recent-list { list-style: none; }
.timeline li, .recent-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid #efedea;
}
.timeline li:last-child, .recent-list li:last-child { border-bottom: none; }
.timeline-time { font-weight: 700; font-size: 13px; color: var(--green-dark); white-space: nowrap; width: 96px; }
.timeline-body, .recent-body { flex: 1; min-width: 0; }
.timeline-meta, .recent-meta { display: block; font-size: 12px; color: var(--muted); }
.recent-no { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---- テーブル ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid #efedea; vertical-align: middle; }
.data-table tr:hover td { background: #faf9f7; }
.data-table tr.is-cancelled td { color: var(--muted); }
.data-table tr.is-inactive td { color: var(--muted); background: #faf9f7; }
.cell-nowrap { white-space: nowrap; }
.cell-center { text-align: center; }
.cell-no { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); }
.cell-desc { font-size: 12.5px; color: var(--ink-soft); }
.cell-actions { white-space: nowrap; }
.cell-actions form { display: inline-block; margin-left: 4px; }
.note-icon { cursor: help; margin-left: 4px; }
.back-link { margin-bottom: 14px; font-size: 13px; }

/* ---- 絞り込みバー ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.filter-bar input, .filter-bar select {
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.filter-clear { font-size: 12.5px; }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* ---- 編集フォーム ---- */
.edit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.edit-grid label { font-size: 12.5px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }
.edit-grid input {
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.edit-grid input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.12); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.edit-actions { margin-top: 16px; display: flex; gap: 10px; }

/* ---- 週間カレンダー ---- */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-range { font-size: 13.5px; font-weight: 700; margin-left: 10px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-chip { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.legend-chip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.calendar {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.cal-corner { border-bottom: 1px solid var(--line); }
.cal-head {
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid #efedea;
}
.cal-head.is-today { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }
.cal-head.is-closed { color: #c0bab0; }

.cal-times { position: relative; }
.cal-time {
  position: absolute;
  right: 8px;
  transform: translateY(-55%);
  font-size: 11px;
  color: var(--muted);
}
.cal-times .cal-time:first-child { transform: none; }

.cal-day {
  position: relative;
  border-left: 1px solid #efedea;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 59px, #e9e6e1 59px, #e9e6e1 60px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 29px, #f3f1ee 29px, #f3f1ee 30px);
}
.cal-day.is-closed { background: repeating-linear-gradient(-45deg, #f7f6f4 0, #f7f6f4 6px, #f1efec 6px, #f1efec 12px); }
.cal-closed-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  writing-mode: vertical-rl;
  letter-spacing: 0.4em;
  color: #b6afa4;
  font-size: 12px;
}

.cal-block {
  position: absolute;
  border-radius: 4px;
  padding: 3px 6px;
  color: #fff;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(43, 39, 35, 0.25);
}
.cal-block:hover { filter: brightness(1.08); }
.cal-block-time { display: block; font-weight: 700; font-size: 10.5px; opacity: 0.9; }
.cal-block-name { display: block; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.cal-block-service { display: block; font-size: 10px; opacity: 0.85; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.cal-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

.st-c1 { background: #b08d57; }
.st-c2 { background: #7d8464; }
.st-c3 { background: #a06a52; }
.st-c4 { background: #6f8f7d; }
i.st-c1 { background: #b08d57; }
i.st-c2 { background: #7d8464; }
i.st-c3 { background: #a06a52; }
i.st-c4 { background: #6f8f7d; }

/* ---- ログイン ---- */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 600px 400px at 80% 10%, rgba(176, 141, 87, 0.18), transparent 60%),
    linear-gradient(135deg, #322c26, #453c32);
}
.login-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 38px 40px 30px;
  width: 380px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 18px 50px rgba(20, 16, 12, 0.4);
}
.login-brand { font-family: var(--serif); font-size: 26px; text-align: center; letter-spacing: 0.06em; }
.login-label { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.2em; margin-bottom: 24px; }
.login-box .form-row { margin-bottom: 16px; }
.login-box label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px; }
.login-box input {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.login-box input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.12); }
.login-demo {
  margin-top: 22px;
  background: var(--green-pale);
  border: 1px dashed #b7d0c2;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  text-align: center;
}
.login-demo-title { font-size: 11.5px; color: var(--green-dark); letter-spacing: 0.1em; margin-bottom: 2px; }
.login-demo code { background: #fff; padding: 1px 8px; border-radius: 3px; font-size: 13px; }
.login-back { text-align: center; margin-top: 18px; font-size: 12.5px; }
.login-back a { color: var(--muted); text-decoration: none; }
.login-back a:hover { color: var(--green); }

/* ---- レスポンシブ（簡易） ---- */
@media (max-width: 960px) {
  body.admin { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 0; }
  .sidebar-nav a { border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-nav a.is-active { border-bottom-color: var(--gold); }
  .sidebar-foot { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
  .admin-content { padding: 18px 16px 50px; }
}
