/* 家族アルバムの管理サイト（docs/03 の 7.）。アプリと同じコーラル色 */
:root {
  --coral: #ef5b3c;
  --coral-soft: #fde4dd;
  --mint: #3dcca4;
  --mint-soft: #d8f5ec;
  --sun: #ffc845;
  --sun-soft: #fff1cc;
  --sky: #4db5ff;
  --sky-soft: #dcefff;
  --ink: #3a3135;
  --muted: #8a7f84;
  --line: #eee4dc;
  --bg: #fff8f1;
  --card: #ffffff;
  --danger: #d93a2b;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 10px; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; padding: 20px 12px; background: var(--card);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar a { color: var(--ink); padding: 9px 12px; border-radius: 10px; display: flex; align-items: center; gap: 8px; }
.sidebar a:hover { background: var(--bg); text-decoration: none; }
.sidebar a.active { background: var(--coral-soft); color: var(--coral); font-weight: bold; }
.sidebar .brand { font-weight: bold; font-size: 16px; margin-bottom: 14px; }
.sidebar .brand small { color: var(--muted); font-weight: normal; font-size: 12px; }
.logo { width: 22px; height: 22px; border-radius: 7px; background: var(--coral); display: inline-block; position: relative; }
.logo::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
main { flex: 1; padding: 28px 32px 60px; min-width: 0; }
.badge { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; margin-left: auto; }

.card { background: var(--card); border-radius: 16px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(58, 49, 53, .05); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: bold; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--coral-soft); border-color: var(--coral); }
textarea { width: 100%; min-height: 70px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { color: var(--ink); font-size: 14px; }
label.check { display: inline-flex; gap: 6px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

button {
  font: inherit; border: none; border-radius: 99px; padding: 7px 16px; cursor: pointer;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
button:hover { filter: brightness(.97); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--coral); color: #fff; border-color: var(--coral); font-weight: bold; }
button.danger { background: #fff; color: var(--danger); border-color: #f3c3bd; }
button.small { padding: 3px 10px; font-size: 12px; }
button.link { background: none; border: none; color: var(--coral); padding: 0; text-align: left; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(58, 49, 53, .05); }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: normal; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fffdfb; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fffaf6; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.chip { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: bold; background: var(--bg); }
.chip.free { background: var(--mint-soft); }
.chip.premium { background: var(--sun-soft); }
.chip.special { background: var(--coral-soft); color: var(--coral); }
.chip.suspended, .chip.deleted { background: #fbe1de; color: var(--danger); }
.chip.ok { background: var(--mint-soft); }
.chip.info { background: var(--sky-soft); }

.user { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--sky-soft); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--line); display: block; cursor: zoom-in; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; cursor: default; }

.grid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card { background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(58, 49, 53, .05); display: flex; flex-direction: column; }
.media-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); cursor: zoom-in; display: block; }
.media-card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.media-card .actions { display: flex; gap: 6px; padding: 0 12px 12px; }

.notice { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.notice.warn { background: var(--sun-soft); }
.notice.error { background: #fbe1de; color: var(--danger); }
.notice.info { background: var(--sky-soft); }
.loading { color: var(--muted); padding: 40px 0; }
.empty { color: var(--muted); padding: 30px; text-align: center; background: var(--card); border-radius: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.more { display: flex; justify-content: center; margin-top: 14px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

dialog { border: none; border-radius: 18px; padding: 0; max-width: min(92vw, 900px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(40, 30, 35, .45); }
dialog .dialog-body { padding: 20px 22px; }
dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 18px; }
dialog img.full, dialog video.full { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 10px; background: #000; }

dialog:focus { outline: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  background: var(--danger); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  max-width: min(90vw, 600px);
}
