/* ねこぷる 管理画面（Django 版）。試作の admin.css と同じ見た目に寄せる。 */
:root { --bar-h: 48px; --border: #e5e7eb; --muted: #6b7280; --text: #111827; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; color: var(--text); background: #f3f4f6; font-size: 14px; line-height: 1.6; }
a { color: #1d4ed8; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; background: #1f2937; color: #fff; padding: 0 16px; height: var(--bar-h); }
.bar-title { font-size: 15px; }
.bar-who { margin-left: auto; font-size: 13px; color: #d1d5db; }
.bar-logout button { background: none; border: 1px solid #4b5563; color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 44px; }
.bar { height: auto; min-height: var(--bar-h); }
.skip { position: absolute; left: -10000px; top: 0; background: #fff; color: #1d4ed8; padding: 10px 14px; z-index: 30; }
.skip:focus { left: 8px; top: 8px; }

.wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.wrap.no-nav { grid-template-columns: minmax(0, 1fr); }
.nav { background: #fff; border-right: 1px solid var(--border); padding: 8px 0; position: sticky; top: var(--bar-h); align-self: start; height: calc(100vh - var(--bar-h)); overflow-y: auto; }
.nav a { display: block; padding: 10px 16px; color: #374151; text-decoration: none; min-height: 44px; }
.nav a:hover { background: #f9fafb; }
.nav a[aria-current="page"] { background: #eef2ff; color: #1e3a8a; font-weight: 700; border-left: 3px solid #1e3a8a; padding-left: 13px; }
.nav-group { font-size: 11px; font-weight: 700; color: #6b7280; padding: 14px 16px 4px; border-top: 1px solid #f3f4f6; margin: 6px 0 0; }
.main { padding: 20px 24px 40px; max-width: 1400px; min-width: 0; }
.main:focus { outline: none; }
.wrap.no-nav .main { margin: 0 auto; width: 100%; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
h2 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.note { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: #374151; font-size: 13px; }
.note.small, .small { font-size: 12px; background: none; border: 0; padding: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; color: inherit; text-decoration: none; }
.card b { font-size: 26px; }
.card.warn { border-color: #f59e0b; background: #fffbeb; }
.card.danger { border-color: #dc2626; background: #fef2f2; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
th { background: #f9fafb; color: #4b5563; white-space: nowrap; }
td.nw { white-space: nowrap; }
td.wide { min-width: 220px; }
td.ua { font-size: 12px; color: var(--muted); min-width: 180px; max-width: 360px; overflow-wrap: anywhere; }
.wrap-code { overflow-wrap: anywhere; word-break: break-all; }
tr.row-warn td { background: #fffbeb; }
tr.row-danger td { background: #fef2f2; }
tr.row-off td { color: #9ca3af; }
.badge { font-size: 12px; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 8px; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0 16px; }
.panel.narrow { max-width: 420px; margin: 8vh auto 0; }
.panel h2 { margin-top: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tab { white-space: nowrap; padding: 10px 12px; color: #4b5563; text-decoration: none; border-bottom: 2px solid transparent; min-height: 44px; }
.tab.on { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4b5563; }
.field.grow { flex: 1 1 200px; }
input, select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; min-height: 44px; }
input[aria-invalid="true"] { border-color: #b42318; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn { font: inherit; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 8px 14px; min-height: 44px; cursor: pointer; background: #fff; border: 1px solid #d1d5db; color: #1f2937; }
.btn.primary { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.warn { color: #b45309; border-color: #f59e0b; }
.btn.wide { width: 100%; margin: 8px 0; }
.btn:disabled { opacity: .6; cursor: wait; }
.err { color: #b42318; font-size: 13px; margin: 8px 0 0; }
.err:empty { margin: 0; }
.err-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; }
.err-box p { margin: 2px 0; }
.flash { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; }
.flash p { margin: 2px 0; }
.table-wrap:focus-visible { outline: 2px solid #2563eb; }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0; }
  .nav a { white-space: nowrap; }
  .nav a[aria-current="page"] { border-left: 0; border-bottom: 3px solid #1e3a8a; padding-left: 16px; }
  .nav-group { display: none; }
  .main { padding: 12px 12px 32px; }
  .form-row .btn { flex: 1 1 100%; }
}
/* 認証アプリの登録 */
.steps { padding-left: 1.4em; font-size: 13px; color: #374151; }
.steps li { margin: 4px 0; }
.secret-key { background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 8px; padding: 10px 12px; text-align: center; margin: 4px 0 10px; }
.secret-key code { display: block; font-size: 16px; line-height: 1.8; letter-spacing: .08em; word-spacing: .3em; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.code-input { font-size: 20px; letter-spacing: .25em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
@media (max-width: 480px) { .panel.narrow { margin-top: 12px; } }
form.inline { display: inline; }
td .btn.small { min-height: 30px; padding: 3px 10px; font-size: 12px; margin: 2px 4px 2px 0; }
.review { margin-bottom: 12px; }
.review-text { white-space: normal; overflow-wrap: anywhere; background: #f9fafb; border-radius: 8px; padding: 8px 10px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.review-actions form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.review-actions select { min-height: 44px; font: inherit; max-width: 100%; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.review-photo { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #f3f4f6; }
.kyc-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 10px 0; }
.kyc-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.kyc-form input { min-height: 44px; font: inherit; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 8px; }
.kyc-reject { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.kyc-face { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 8px; margin: 6px 0; background: #f3f4f6; }
