/* ===== 管理サイト ===== */
body.admin { padding-bottom: 0; background: var(--bg); }
.abar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #1d1d1f; color: #fff; padding: 12px 20px; }
.atitle { color: #fff; text-decoration: none; font-size: 16px; }
.atitle b { color: #ff6b81; margin-right: 4px; }
.aright { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.awho { display: inline-flex; align-items: center; gap: 6px; }
.alink { color: #ddd; background: none; border: 0; font-size: 13px; text-decoration: none; padding: 0; }
.alink:hover { color: #fff; }
body.admin .gate { margin-top: 40px; text-align: left; }
body.admin .gate h2 { text-align: center; }
body.admin .gate select, #lgPw, #upNew, #upNew2 { width: 100%; font-size: 16px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
#lgPw, #upNew, #upNew2 { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.admin .gate .check { display: flex; gap: 8px; align-items: center; }
body.admin .gate .check input { width: 18px; height: 18px; accent-color: var(--red); }

.alayout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 48px); }
.aside { background: var(--card); border-right: 1px solid var(--line); padding: 14px 8px; position: sticky; top: 0; height: calc(100vh - 48px); overflow-y: auto; }
.amain { padding: 20px 28px 60px; max-width: 1100px; width: 100%; }
.ptitle { font-size: 22px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
.ptitle small { font-size: 13px; color: var(--muted); font-weight: 400; }
@media (max-width: 800px) {
  .alayout { display: block; }
  .aside { position: sticky; top: 0; z-index: 5; height: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .aside .slink { width: auto; white-space: nowrap; padding: 8px 12px; font-size: 14px; }
  .amain { padding: 16px; }
  .aright .awho span { display: none; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--red-line); }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat b { font-size: 22px; }
.stat small { font-size: 12px; color: var(--muted); }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.notice a { color: inherit; }
.arow.bill { align-items: flex-start; }
.billset { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.billset select, .billset input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.invs { margin-top: 8px; display: grid; gap: 6px; }
.inv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.inv span:first-child { flex: 1; min-width: 12em; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 12px; }
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.setgrid .wide { grid-column: 1 / -1; }
.setgrid .aset { margin: 0; }

/* ===== 管理サイト：レスポンシブ調整 ===== */
.alayout { grid-template-columns: 220px minmax(0, 1fr); }
.amain { min-width: 0; }
.atitle, .alink { white-space: nowrap; }
.stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 640px) {
  .abar { padding: 10px 14px; }
  .atitle { font-size: 14px; }
  .aright { gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 18px; }
  .cols2, .setgrid { grid-template-columns: 1fr; }
  .billset { gap: 6px; }
}
.mtg { display: grid; gap: 10px; margin-bottom: 10px; }
.mtghead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mtghead .soft { margin-left: auto; }
.mtgp { display: flex; gap: 10px; align-items: flex-start; border-top: 1px dashed var(--line); padding-top: 10px; }
.mtgp .grow { flex: 1; min-width: 0; word-break: break-all; }
.mtgp .soft { flex-shrink: 0; }
/* スマホ：検索欄とボタンが横にはみ出さないように */
.atools .search { flex: 1 1 200px; min-width: 0; }
.atools .search input { min-width: 0; }
.atools > button { flex-shrink: 0; }
@media (max-width: 480px) { .atools { flex-wrap: wrap; } .atools > button { width: 100%; } }
