body.admin { background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy-deep), var(--navy)); }
.login { width: min(420px, 100%); }
.login .logo { text-align: center; margin-bottom: 14px; }
.login .logo img { margin: 0 auto 8px; width: 84px; }
.login h1 { text-align: center; font-size: 1.3rem; margin: 0 0 4px; }
.login .sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: .94rem; }

.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; padding: 6px 0; }
.top img { width: 38px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.top b { font-size: 1rem; }
.top .sp { flex: 1; }
.top .who { font-size: .85rem; color: #c9d5ea; }
.top .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.top .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

.tabs { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs .wrap { display: flex; gap: 4px; }
.tab { padding: 14px 18px; border: 0; background: none; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--navy); border-color: var(--red); }
.page { padding: 24px 0 60px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select, .toolbar input[type=search] { width: auto; min-width: 150px; padding: 10px 12px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 8px rgba(15, 34, 64, .07); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--navy); }
.stat span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat i { display: block; height: 6px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.stat i em { display: block; height: 100%; background: var(--ok); }

.tablebox { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(15, 34, 64, .07); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 12px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.cancelled td { color: #98a3b3; text-decoration: line-through; }
tr.cancelled td:last-child { text-decoration: none; }
.code { font: 700 .95rem ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e8edf6; color: var(--navy); white-space: nowrap; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.off { background: #f1f1f1; color: #777; }
.badge.warn { background: #fdf1d9; color: #8a5a00; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.muted { color: var(--muted); }
.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(15, 34, 64, .07); margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; font-weight: 600; }
.check input { width: 18px; height: 18px; }
.bars { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.bar-row { display: grid; grid-template-columns: 200px 1fr 36px; gap: 10px; align-items: center; font-size: .9rem; }
.bar-row i { display: block; height: 10px; background: var(--navy); border-radius: 5px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; z-index: 99; box-shadow: var(--shadow); }
.copybox { display: flex; gap: 8px; margin-top: 8px; }
.copybox input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
dialog { border: 0; border-radius: 14px; padding: 24px; width: min(560px, 94vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 34, 64, .55); }
dialog h3 { margin-top: 0; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 30px; }
  th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { display: none; }
}
