* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: #1a1a2e; background: #f4f5f8; }

/* ログイン */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e, #16213e); }
.login-card { background: #fff; padding: 40px; border-radius: 16px; width: 360px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card .sub { color: #888; font-size: 13px; margin-bottom: 24px; }
.msg { margin-top: 14px; font-size: 13px; color: #4a7; min-height: 18px; }
.msg.err { color: #d33; }
.fallback { margin-top: 24px; text-align: left; font-size: 13px; color: #666; }
.fallback summary { cursor: pointer; }
.fallback input { width: 100%; padding: 10px; margin-top: 8px; border: 1px solid #ddd; border-radius: 8px; }

/* ボタン */
.btn-primary { width: 100%; padding: 14px; background: #2d4de0; color: #fff; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: #223bb8; }
.btn-secondary { padding: 10px 16px; background: #e8eaf2; color: #2d4de0; border: none; border-radius: 8px; cursor: pointer; margin-top: 8px; }
.btn-ghost { padding: 8px 12px; background: transparent; border: 1px solid #ccd; border-radius: 8px; cursor: pointer; font-size: 13px; }

/* アプリ */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #1a1a2e; color: #fff; }
.topbar .logo { font-weight: bold; }
.top-actions { display: flex; gap: 8px; }
.top-actions .btn-ghost { color: #fff; border-color: #445; }
.filters { position: fixed; top: 56px; left: 0; width: 280px; height: calc(100vh - 56px); overflow-y: auto; padding: 20px; background: #fff; border-right: 1px solid #e0e0e8; }
.filters h2 { font-size: 15px; margin-bottom: 16px; }
.filters label { display: block; font-size: 13px; color: #555; margin-bottom: 12px; }
.filters input, .filters select { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ddd; border-radius: 6px; }
.filters .range { margin-bottom: 12px; font-size: 13px; color: #555; }
.filters .range span { display: block; margin-bottom: 4px; }
.filters .range input { width: 48%; display: inline-block; }
.filters .sortrow { display: flex; gap: 6px; }
.results { margin-left: 280px; padding: 20px; }
.summary { font-size: 14px; color: #555; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
th { background: #f0f1f6; font-weight: 600; }
tr:hover td { background: #f8f9ff; }
.empty { padding: 40px; text-align: center; color: #999; }
.pager { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }

/* ローディングスピナー */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.loading-overlay.hidden { display: none; }
.spinner { width: 48px; height: 48px; border: 4px solid #d8dcf0; border-top-color: #2d4de0; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .6; cursor: wait; }
