*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #c9a96e; --dark: #0d0d0d; --dark2: #1a1a1a; --dark3: #252525;
  --sidebar-w: 240px; --text: #333; --text-light: #777; --white: #fff;
  --bg: #f5f5f5; --radius: 12px;
}
body.admin-body { font-family: 'Noto Sans JP', sans-serif; font-weight: 300; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ===== Login ===== */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%); }
.login-card { background: #fff; border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-logo { display: flex; align-items: center; gap: 8px; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; color: var(--dark); margin-bottom: 8px; }
.login-logo svg { color: var(--dark); }
.login-card h2 { font-size: 1rem; font-weight: 500; color: var(--dark); margin-bottom: 28px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 10px 22px; border-radius: 8px; font-size: 0.82rem; font-weight: 500; cursor: pointer; border: none; font-family: 'Noto Sans JP', sans-serif; transition: all 0.2s; }
.btn-primary { background: var(--gold); color: var(--dark); }
.btn-primary:hover { background: #e8d5b0; }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; border-radius: 6px; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; border: 1px solid #ddd; color: var(--text); }
.btn-ghost:hover { background: #f5f5f5; }
.btn-full { width: 100%; }
.hidden { display: none !important; }

/* ===== Form ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }
.form-input { width: 100%; padding: 10px 13px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.85rem; font-family: 'Noto Sans JP', sans-serif; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--gold); }
.form-select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.85rem; font-family: 'Noto Sans JP', sans-serif; outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-color: #fff; }
.form-select:focus { border-color: var(--gold); }
.form-textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.85rem; font-family: 'Noto Sans JP', sans-serif; resize: vertical; outline: none; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== Admin App ===== */
.admin-app { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.admin-sidebar { width: var(--sidebar-w); background: var(--dark2); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transition: transform 0.3s ease; }

.sidebar-logo {
  display: flex; align-items: center; gap: 9px;
  font-family: 'Cormorant Garamond', serif; font-size: 1.15rem;
  color: var(--white); padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.06em;
}
.sidebar-logo svg { color: rgba(255,255,255,0.7); flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; font-size: 0.81rem;
  color: rgba(255,255,255,0.5); transition: all 0.2s;
  cursor: pointer; border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--gold); background: rgba(201,169,110,0.08); border-left-color: var(--gold); }

/* SVG icon in nav */
.nav-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
}

.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.07); }
.btn-logout {
  width: 100%; padding: 9px 12px; background: rgba(255,255,255,0.06);
  border: none; color: rgba(255,255,255,0.45); border-radius: 8px;
  font-size: 0.78rem; cursor: pointer; font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.2s; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-logout:hover { background: rgba(255,255,255,0.11); color: #fff; }
.btn-logout svg { flex-shrink: 0; }

/* ===== Main ===== */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.admin-topbar {
  background: var(--white); padding: 0 24px; height: 58px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; line-height: 0; }
.page-title { font-size: 0.95rem; font-weight: 500; color: var(--dark); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-name { font-size: 0.8rem; color: var(--text-light); }
.admin-content { padding: 24px; flex: 1; }

/* ===== Stat Cards ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 18px; box-shadow: 0 1px 6px rgba(0,0,0,0.05); border-left: 3px solid var(--gold); }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: #10b981; }
.stat-card.purple { border-left-color: #8b5cf6; }
.stat-label { font-size: 0.7rem; color: var(--text-light); margin-bottom: 7px; letter-spacing: 0.04em; }
.stat-value { font-size: 1.7rem; font-weight: 500; color: var(--dark); line-height: 1; margin-bottom: 3px; }
.stat-sub { font-size: 0.7rem; color: var(--text-light); }

/* ===== Table Card ===== */
.table-card { background: var(--white); border-radius: var(--radius); box-shadow: 0 1px 6px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 22px; }
.table-header { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; gap: 10px; }
.table-header h3 { font-size: 0.88rem; font-weight: 500; color: var(--dark); }
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input { padding: 7px 11px; border: 1px solid #ddd; border-radius: 7px; font-size: 0.78rem; font-family: 'Noto Sans JP', sans-serif; outline: none; width: 160px; }
.search-input:focus { border-color: var(--gold); }

/* ===== Responsive Table ===== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th {
  background: #fafafa; padding: 10px 14px;
  font-size: 0.72rem; font-weight: 500; color: var(--text-light);
  text-align: left; border-bottom: 1px solid #efefef;
  position: sticky; top: 0;
}
.data-table td {
  padding: 11px 14px; font-size: 0.81rem; color: var(--text);
  border-bottom: 1px solid #f8f8f8; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fdfcfa; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 50px; font-size: 0.67rem; font-weight: 500; white-space: nowrap; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }

.table-actions-cell { display: flex; gap: 5px; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--white); border-radius: 16px; padding: 28px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.modal-header h3 { font-size: 0.95rem; font-weight: 500; color: var(--dark); }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-light); line-height: 1; padding: 2px 6px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eee; }

/* ===== Price Grid ===== */
.price-grid-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.price-grid-table th { background: #1a1a1a; color: #fff; padding: 9px 12px; font-size: 0.72rem; font-weight: 500; text-align: center; }
.price-grid-table th:first-child { text-align: left; }
.price-grid-table td { padding: 9px 12px; font-size: 0.8rem; border-bottom: 1px solid #f0f0f0; text-align: center; }
.price-grid-table td:first-child { text-align: left; font-weight: 500; }
.price-input { width: 88px; padding: 5px 7px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.78rem; text-align: right; outline: none; font-family: 'Noto Sans JP', sans-serif; }
.price-input:focus { border-color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 1024px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 14px; }
  .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
}
