/* Re-Start 管理画面 — WordPress風UI */
* { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --wp-dark: #1d2327;
  --wp-dark-2: #2c3338;
  --wp-blue: #2271b1;
  --wp-blue-dark: #135e96;
  --wp-bg: #f0f0f1;
  --wp-border: #c3c4c7;
  --wp-text: #3c434a;
  --green: #2e8b6c;
  --red: #d63638;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--wp-bg);
  color: var(--wp-text);
  font-size: 14px;
}

/* ===== ログイン ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wp-bg);
}

.login-card {
  width: 340px;
  background: #fff;
  border: 1px solid var(--wp-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 32px;
  border-radius: 4px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 15px;
}

.login-logo-img { width: 200px; }

.sidebar-logo {
  width: 24px;
  height: 26px;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 1px;
}

.login-mark, .sidebar-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2e8b6c 0 55%, #55add6 55%);
  display: inline-block;
}

.login-card label {
  display: block;
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid var(--wp-border);
  border-radius: 3px;
  margin-bottom: 16px;
}

.login-error {
  color: var(--red);
  margin: 12px 0 0;
  text-align: center;
}

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

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--wp-dark);
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 700;
  color: #fff;
  background: var(--wp-dark-2);
}

.sidebar-nav {
  flex: 1;
  padding-top: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e0e0e0;
  text-decoration: none;
  padding: 10px 16px;
}

.sidebar-nav a:hover {
  color: #72aee6;
}

.sidebar-nav a.active {
  background: var(--wp-blue);
  color: #fff;
}

.nav-icon {
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.sidebar-foot a {
  color: #9ec2e6;
  text-decoration: none;
  font-size: 13px;
}

.sidebar-foot button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e0e0e0;
  border-radius: 3px;
  padding: 6px;
  cursor: pointer;
}

.sidebar-foot button:hover {
  border-color: #72aee6;
  color: #72aee6;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 0;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

.save-status {
  color: var(--green);
  font-size: 13px;
}

.content {
  padding: 20px 28px 48px;
}

/* ===== 共通パーツ ===== */
.btn {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 3px;
  border: 1px solid var(--wp-blue);
  background: #f6f7f7;
  color: var(--wp-blue);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #f0f6fc; }

.btn-primary {
  background: var(--wp-blue);
  color: #fff;
}

.btn-primary:hover { background: var(--wp-blue-dark); }

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-block { width: 100%; padding: 10px; font-size: 14px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* 一覧テーブル */
.list-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--wp-border);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.list-table th, .list-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f1;
}

.list-table thead th {
  border-bottom: 1px solid var(--wp-border);
  font-weight: 600;
}

.list-table tbody tr:hover { background: #f6f7f7; }

.list-table .row-title {
  color: var(--wp-blue);
  font-weight: 600;
  cursor: pointer;
}

.list-table .row-title:hover { color: var(--wp-blue-dark); text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
}

.badge-published { background: #e6f2ec; color: var(--green); }
.badge-draft { background: #f0f0f1; color: #777; }

.row-actions { white-space: nowrap; }

.row-actions button {
  background: none;
  border: none;
  color: var(--wp-blue);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
}

.row-actions button.danger { color: var(--red); }
.row-actions button:hover { text-decoration: underline; }

.empty-note {
  background: #fff;
  border: 1px solid var(--wp-border);
  padding: 28px;
  text-align: center;
  color: #777;
}

/* 編集フォーム */
.edit-card {
  background: #fff;
  border: 1px solid var(--wp-border);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 24px;
  max-width: 720px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--wp-border);
  border-radius: 3px;
  font-family: inherit;
}

.field textarea { min-height: 120px; resize: vertical; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f1;
}

.form-error { color: var(--red); }

/* ダッシュボード */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 720px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--wp-border);
  padding: 20px;
  cursor: pointer;
}

.dash-card:hover { border-color: var(--wp-blue); }

.dash-card strong { font-size: 28px; display: block; }
.dash-card span { color: #777; }

.dash-note {
  max-width: 720px;
  margin-top: 20px;
  background: #fff;
  border-left: 4px solid var(--wp-blue);
  border-top: 1px solid var(--wp-border);
  border-right: 1px solid var(--wp-border);
  border-bottom: 1px solid var(--wp-border);
  padding: 14px 18px;
  line-height: 1.8;
}

/* 空き状況 */
.avail-card {
  background: #fff;
  border: 1px solid var(--wp-border);
  padding: 24px;
  max-width: 560px;
}

.avail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.avail-table th, .avail-table td {
  padding: 10px;
  border-bottom: 1px solid #f0f0f1;
  text-align: center;
}

.avail-table select {
  padding: 6px 8px;
  border: 1px solid var(--wp-border);
  border-radius: 3px;
  font-size: 14px;
}

.avail-updated { color: #777; font-size: 13px; }

/* ===== Quillエディタ ===== */
.quill-container {
  background: #fff;
  border: 1px solid var(--wp-border);
  border-radius: 3px;
  min-height: 240px;
}

.quill-container .ql-toolbar {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--wp-border);
  background: #fafafa;
}

.quill-container .ql-container {
  border: none;
  font-family: inherit;
  font-size: 14px;
  min-height: 200px;
}

.quill-container .ql-editor {
  min-height: 200px;
  line-height: 1.8;
}

/* ===== サムネイル ===== */
.thumb-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.thumb-preview {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--wp-border);
  border-radius: 4px;
}

.thumb-placeholder {
  width: 180px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--wp-border);
  border-radius: 4px;
  color: #aaa;
  font-size: 13px;
  background: #fafafa;
}

.thumb-btn {
  cursor: pointer;
  align-self: flex-end;
}

@media (max-width: 782px) {
  .sidebar { width: 56px; }
  .sidebar-brand span:last-child, .sidebar-nav a span:last-child { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px 0; }
  .sidebar-nav a .nav-icon { width: auto; font-size: 16px; }
  .sidebar-foot { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 14px 16px 0; }
}
