/* 予約ページ(book.html)とトーンを統一した管理画面スタイル。
   デザイントークンは book.html から移植（淡い背景・控えめな影・緑アクセント）。 */
: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;
  --line-green: #06c755;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --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-outfit: 'Outfit', 'Inter', sans-serif;
  --font-inter: 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-inter);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: radial-gradient(circle at 10% 20%, rgba(240, 253, 244, 0.5) 0%, rgba(248, 250, 252, 1) 90%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Sidebar */
aside {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  z-index: 10;
}

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

aside .logo::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

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;
  display: flex;
  align-items: center;
  gap: 12px;
  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;
}

aside nav li.active .icon {
  opacity: 1;
}

aside nav li#nav-rsv-settings.active {
  background: #6366f1;
  color: white;
}

aside nav li .icon {
  font-size: 16px;
  opacity: 0.7;
}

/* Main Content */
main {
  flex: 1;
  overflow-y: auto;
  padding: 48px 52px;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

h1 {
  font-family: var(--font-outfit);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  -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-outfit);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 22px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow 0.25s ease;
}

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

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-outfit);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--primary);
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

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: #f8fafc;
}

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

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

/* Table Controls */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  background: white;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
  transition: all 0.2s ease;
}

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

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-group select {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-group select:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0;
}

.btn-refresh {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.btn-refresh:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-refresh.loading {
  animation: spin 0.8s linear infinite;
  pointer-events: none;
  opacity: 0.6;
}

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

tr.selected-row td {
  background-color: var(--primary-light) !important;
}

tr:hover td {
  background: #f8fafc;
}

/* Badges */
.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-noshow { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.stat-value-cancelled { color: #dc2626; }
.stat-value-noshow { color: #ea580c; }
.badge-admin { background: #4338ca; color: white; border: 1px solid #4338ca; display: inline-flex; align-items: center; border-radius: 99px; }

/* 管理者モードバナー（サイドバー）— ロール識別。indigo で店舗側の緑テーマと区別 */
.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;
}
.badge-owner { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; display: inline-flex; align-items: center; border-radius: 99px; }

/* Forms */
input, select, textarea {
  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);
}

/* Primary Button */
button {
  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;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Secondary Button */
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);
  transform: none;
}

/* Settings Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e2e8f0;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

input:checked + .slider { background-color: var(--line-green); }
input:checked + .slider:before { transform: translateX(18px); }

/* Sections Visibility */
.content-section {
  display: none;
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.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);
}

/* Business Hours Table */
.hours-table { border: none; }
.hours-table th, .hours-table td { border-bottom: 1px solid #f1f5f9; }
.hours-table input[type="time"] { margin-bottom: 0; padding: 6px 10px; width: auto; }

/* Login */
#login-overlay {
  background: radial-gradient(circle at 30% 20%, rgba(240, 253, 244, 0.6) 0%, rgba(248, 250, 252, 1) 80%);
}

#login-box {
  background: white;
  padding: 48px;
  border-radius: 24px;
  width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
