/* Gotanda Guide — Admin Dashboard styles */

:root[data-theme="dark"] {
  --adm-bg: #0a0a0c;
  --adm-bg-2: #14141a;
  --adm-bg-3: #1c1c24;
  --adm-line: rgba(255,255,255,0.08);
  --adm-line-2: rgba(255,255,255,0.14);
  --adm-fg: #e8e6e1;
  --adm-fg-low: #999894;
  --adm-fg-faint: #5b5a57;
  --adm-accent: #f5b25b;
  --adm-accent-2: #ff5b8a;
  --adm-danger: #ff5b6b;
}

body {
  background: var(--adm-bg);
  color: var(--adm-fg);
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  font-size: 14px;
  margin: 0;
}

.adm-shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  max-width: none;
}

/* Header */
.adm-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--adm-bg-2);
  border-bottom: 1px solid var(--adm-line);
}
.adm-hdr-brand { display: flex; align-items: center; gap: 12px; }
.adm-logo {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--adm-accent);
  color: #0a0a0c;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  border-radius: 8px;
}
.adm-hdr-title { font-weight: 600; font-size: 14px; }
.adm-hdr-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--adm-fg-faint);
  text-transform: uppercase;
}
.adm-hdr-link {
  color: var(--adm-fg-low);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--adm-line);
  border-radius: 6px;
  transition: border-color 0.15s ease;
}
.adm-hdr-link:hover { border-color: var(--adm-accent); color: var(--adm-fg); }

/* Tabs */
.adm-tabs {
  display: flex;
  gap: 0;
  background: var(--adm-bg-2);
  border-bottom: 1px solid var(--adm-line);
  padding: 0 24px;
  overflow-x: auto;
}
.adm-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--adm-fg-low);
  padding: 14px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.adm-tab:hover { color: var(--adm-fg); }
.adm-tab.is-on {
  color: var(--adm-accent);
  border-bottom-color: var(--adm-accent);
}
.adm-tab-icon { font-size: 14px; }

/* Main */
.adm-main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.adm-panel { display: flex; flex-direction: column; gap: 16px; }

/* Toolbar */
.adm-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.adm-toolbar-spacer { flex: 1; }
.adm-search { min-width: 240px; flex: 1; max-width: 400px; }

.adm-stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--adm-fg-faint);
  letter-spacing: 0.04em;
}

/* Inputs */
.adm-input {
  background: var(--adm-bg-3);
  border: 1px solid var(--adm-line);
  color: var(--adm-fg);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.adm-input:focus { border-color: var(--adm-accent); }
textarea.adm-input { resize: vertical; font-family: inherit; }

/* Buttons */
.adm-shell .btn-primary {
  background: var(--adm-accent);
  color: #0a0a0c;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.adm-shell .btn-primary:hover { background: var(--adm-accent-2); color: #fff; }
.adm-shell .btn-secondary {
  background: transparent;
  color: var(--adm-fg);
  border: 1px solid var(--adm-line-2);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.adm-shell .btn-secondary:hover { border-color: var(--adm-accent); }
.btn-danger {
  background: var(--adm-danger);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.adm-btn-sm {
  background: var(--adm-bg-3);
  border: 1px solid var(--adm-line);
  color: var(--adm-fg);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}
.adm-btn-sm:hover { border-color: var(--adm-accent); color: var(--adm-accent); }
.adm-btn-danger:hover { border-color: var(--adm-danger); color: var(--adm-danger); }

/* Table */
.adm-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--adm-bg-2);
  border: 1px solid var(--adm-line);
  border-radius: 8px;
  overflow: hidden;
}
.adm-table th, .adm-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--adm-line);
  font-size: 13px;
  vertical-align: middle;
}
.adm-table th {
  background: var(--adm-bg-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--adm-fg-faint);
  font-weight: 500;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: rgba(255,255,255,0.02); }

.adm-tbl-thumb {
  width: 48px; height: 48px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  border: 1px solid var(--adm-line);
}
.adm-tbl-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--adm-bg-3);
  color: var(--adm-fg-faint);
  font-size: 16px;
}
.adm-tbl-name { font-weight: 500; font-size: 13px; }
.adm-tbl-sub { font-size: 11px; color: var(--adm-fg-low); }
.adm-tbl-id { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--adm-fg-faint); }
.adm-tbl-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.adm-mv { display: flex; flex-direction: column; gap: 2px; }
.adm-mv .cat-mv-btn { width: 24px; height: 16px; }

/* Cards */
.adm-card {
  background: var(--adm-bg-2);
  border: 1px solid var(--adm-line);
  border-radius: 10px;
  padding: 18px;
}
.adm-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.adm-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--adm-fg-low);
  line-height: 1.6;
}
.adm-card.adm-danger { border-color: rgba(255,91,107,0.3); }
.adm-card.adm-danger h3 { color: var(--adm-danger); }

.adm-table-sm {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.adm-table-sm td {
  padding: 6px 0;
  border-bottom: 1px solid var(--adm-line);
}
.adm-table-sm tr.adm-total td { border-bottom: none; padding-top: 10px; }

.adm-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--adm-fg-faint);
  line-height: 1.6;
}
.adm-saved { color: var(--adm-accent); font-size: 12px; }
.adm-err { color: #ff8a80; font-size: 12px; }

/* Modal */
.adm-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.adm-modal {
  background: var(--adm-bg-2);
  border: 1px solid var(--adm-line-2);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
}
.adm-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--adm-line);
}
.adm-modal-hd h3 { margin: 0; font-size: 14px; }
.adm-x {
  background: transparent;
  border: none;
  color: var(--adm-fg-low);
  font-size: 22px;
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.adm-x:hover { background: var(--adm-bg-3); color: var(--adm-fg); }

.adm-grid2 {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  padding: 20px;
}
@media (max-width: 600px) {
  .adm-grid2 { grid-template-columns: 1fr; }
}

.adm-fields { display: flex; flex-direction: column; gap: 10px; }
.adm-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--adm-fg-low);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adm-fields label input,
.adm-fields label textarea,
.adm-fields label select {
  font-family: 'Noto Sans JP', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  color: var(--adm-fg);
}
.adm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.adm-thumb-wrap {
  cursor: pointer;
  display: block;
}
.adm-thumb {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 1px dashed var(--adm-line-2);
}
.adm-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--adm-bg-3);
  color: var(--adm-fg-faint);
  font-size: 11px;
  text-align: center;
  padding: 12px;
}

.adm-modal-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--adm-line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Footer */
.adm-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--adm-line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--adm-fg-faint);
  letter-spacing: 0.06em;
  text-align: center;
}

/* Override main-site embedded panels for admin context */
.adm-panel .cat-mgr,
.adm-panel .gp-panel { background: transparent; }
.adm-panel .cat-list { max-height: none; }
