@charset "UTF-8";
/* =============================================================
   管理画面
   数字を読む画面なので、色は控えめにして数値と状態を目立たせる。
   ============================================================= */

:root {
  --c-text:    #1f2430;
  --c-muted:   #757d8a;
  --c-line:    #e3e6ea;
  --c-bg:      #f6f7f9;
  --c-card:    #ffffff;
  --c-primary: #2f6df6;
  --c-ok:      #0f7b4f;
  --c-ng:      #b42318;
  --c-warn:    #a15c07;
  --c-bar:     #2f6df6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

a { color: var(--c-primary); }

/* -------------------------------------------------------------
   ヘッダー
   ------------------------------------------------------------- */
.a-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 52px;
  background: #1f2430;
  color: #fff;
}

.a-brand {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
}

.a-nav { display: flex; gap: 4px; }

.a-nav a {
  color: #c5cbd6;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.a-nav a:hover { background: #2c3342; color: #fff; }
.a-nav a.is-active { background: #2c3342; color: #fff; font-weight: 600; }

.a-spacer { flex: 1; }
.a-me { font-size: 13px; color: #c5cbd6; }
.a-logout { font-size: 13px; color: #c5cbd6; text-decoration: none; }
.a-logout:hover { color: #fff; }

.a-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.a-footer {
  text-align: center;
  color: var(--c-muted);
  font-size: 12px;
  padding: 20px;
}

/* -------------------------------------------------------------
   見出し・共通パーツ
   ------------------------------------------------------------- */
.a-pagehead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.a-pagehead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.a-h1 { font-size: 20px; margin: 0; flex: 1; min-width: 200px; }
.a-h2 { font-size: 15px; margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--c-line); }

.a-breadcrumb { font-size: 12px; color: var(--c-muted); margin: 0 0 10px; }
.a-breadcrumb a { color: var(--c-muted); }

.a-muted { color: var(--c-muted); }
.a-small { font-size: 12px; }
.a-num   { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.a-req   { font-size: 11px; color: var(--c-ng); font-weight: normal; }

.a-note {
  font-size: 12px;
  color: var(--c-muted);
  background: #eef1f5;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 16px;
  line-height: 1.7;
}

.a-help { font-size: 11px; color: var(--c-muted); margin: 5px 0 0; line-height: 1.6; }

.a-empty {
  color: var(--c-muted);
  background: var(--c-card);
  border: 1px dashed var(--c-line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  font-size: 13px;
}

.a-alert {
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 13px;
}
.a-alert-ok   { background: #e8f6ee; color: var(--c-ok); }
.a-alert-ng   { background: #fef3f2; color: var(--c-ng); }
.a-alert-warn { background: #fdf4e3; color: var(--c-warn); }

/* -------------------------------------------------------------
   ボタン・入力
   ------------------------------------------------------------- */
.a-btn {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.a-btn:hover { background: #f2f4f7; }

.a-btn-primary {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
  font-weight: 600;
}
.a-btn-primary:hover { background: #2559d0; }

.a-btn-sm { padding: 4px 9px; font-size: 12px; }
.a-btn-block { width: 100%; }

.a-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 6px;
}
.a-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, .13);
}
.a-input-sm { width: auto; min-width: 180px; }

textarea.a-input { line-height: 1.6; resize: vertical; }

.a-searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.a-searchbar .a-input { max-width: 280px; }
.a-link { font-size: 12px; }

.a-form {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 20px;
}
.a-form-narrow { max-width: 480px; }

.a-field { margin-bottom: 18px; }
.a-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }

.a-check { margin-bottom: 14px; }
.a-check label { font-size: 13px; cursor: pointer; }
.a-check input { margin-right: 6px; }

.a-actions { display: flex; gap: 8px; margin-top: 22px; }
.a-inline-form { display: inline; }

/* -------------------------------------------------------------
   資料カード
   ------------------------------------------------------------- */
.a-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.a-card {
  display: block;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.a-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .09); transform: translateY(-1px); }

.a-card-thumb {
  height: 150px;
  background: #eceff3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--c-line);
}
.a-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.a-thumb-note { font-size: 12px; color: var(--c-muted); }
.a-thumb-ng { color: var(--c-ng); }

.a-card-body { padding: 12px 14px 14px; }
.a-card-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; line-height: 1.5; }
.a-card-meta  { font-size: 11px; color: var(--c-muted); margin: 0 0 8px; }
.a-card-stats { margin: 0 0 6px; display: flex; gap: 6px; }
.a-card-last  { font-size: 11px; color: var(--c-muted); margin: 0; }

.a-chip {
  font-size: 11px;
  background: #eef1f5;
  color: #4a5261;
  border-radius: 4px;
  padding: 2px 7px;
}
.a-chip-view { background: #e6efff; color: #1d4ed8; }

/* -------------------------------------------------------------
   表
   ------------------------------------------------------------- */
.a-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.a-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  background: #f9fafb;
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
}

.a-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: top;
}
.a-table tr:last-child td { border-bottom: none; }
.a-table tr.is-current td { background: #f5f9ff; }
.a-table tr.is-off td { opacity: .55; }

.a-link-label { display: block; font-weight: 600; }
.a-sub { display: block; font-size: 11px; color: var(--c-muted); }

.a-row-actions { white-space: nowrap; }
.a-row-actions > * { margin-right: 4px; }

.a-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

.a-badge {
  display: inline-block;
  font-size: 10px;
  background: #eef1f5;
  color: #545c6b;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.a-badge-ok  { background: #e8f6ee; color: var(--c-ok); }
.a-badge-off { background: #fef3f2; color: var(--c-ng); }

.a-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.a-status-on  { color: var(--c-ok); }
.a-status-off { color: var(--c-muted); }

.a-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; }

/* -------------------------------------------------------------
   資料の詳細
   ------------------------------------------------------------- */
.a-detail {
  display: flex;
  gap: 20px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 18px;
  flex-wrap: wrap;
}

.a-detail-thumb {
  width: 140px;
  min-height: 100px;
  background: #eceff3;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.a-detail-thumb img { width: 100%; display: block; }

.a-detail-meta { flex: 1; min-width: 260px; margin: 0; font-size: 13px; }
.a-detail-meta > div { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid #f4f5f7; }
.a-detail-meta > div:last-child { border-bottom: none; }
.a-detail-meta dt { width: 120px; flex-shrink: 0; color: var(--c-muted); font-size: 12px; }
.a-detail-meta dd { margin: 0; flex: 1; }

.a-detail-meta-wide {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 8px 18px;
}

.a-urlbox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.a-urlbox-label { font-size: 11px; color: #1d4ed8; font-weight: 600; }
.a-urlbox-url { font-size: 12px; word-break: break-all; flex: 1; min-width: 200px; }

/* -------------------------------------------------------------
   数値タイル
   ------------------------------------------------------------- */
.a-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.a-kpi {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 14px 16px;
}
.a-kpi-label { display: block; font-size: 11px; color: var(--c-muted); margin-bottom: 4px; }
.a-kpi-value { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.a-kpi-unit  { font-size: 13px; font-weight: 400; color: var(--c-muted); }

/* -------------------------------------------------------------
   ページごとの滞在時間
   ------------------------------------------------------------- */
.a-pagechart {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 14px 16px;
}

.a-pagerow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}

.a-pagerow-no {
  width: 44px;
  font-size: 11px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.a-pagerow-bar {
  flex: 1;
  height: 14px;
  background: #f0f2f5;
  border-radius: 3px;
  overflow: hidden;
}
.a-pagerow-bar > span {
  display: block;
  height: 100%;
  background: var(--c-bar);
  border-radius: 3px;
}

.a-pagerow-val {
  width: 70px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.a-pagerow-reach {
  width: 48px;
  text-align: right;
  font-size: 11px;
  color: var(--c-muted);
  flex-shrink: 0;
}

/* 誰にも読まれていないページは目立たせない */
.a-pagerow.is-skipped .a-pagerow-bar > span { background: #d6dae0; }
.a-pagerow.is-skipped .a-pagerow-val { color: var(--c-muted); }

/* -------------------------------------------------------------
   ログイン画面
   ------------------------------------------------------------- */
.a-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.a-login-card {
  width: 100%;
  max-width: 340px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 30px 26px;
  text-align: center;
}

.a-login-brand { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.a-login-tag   { font-size: 12px; color: var(--c-muted); margin: 0 0 22px; }
.a-login-card .a-input { margin-bottom: 10px; text-align: left; }

.a-login-error {
  font-size: 12px;
  color: var(--c-ng);
  background: #fef3f2;
  border-radius: 5px;
  padding: 8px;
  margin: 0 0 14px;
}

/* -------------------------------------------------------------
   コピー完了の表示
   ------------------------------------------------------------- */
.a-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 12px);
  background: #1f2430;
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 100;
  pointer-events: none;
}
.a-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------
   狭い画面
   ------------------------------------------------------------- */
@media (max-width: 640px) {
  .a-header { gap: 10px; padding: 0 12px; }
  .a-nav a { padding: 6px 8px; }
  .a-me { display: none; }
  .a-main { padding: 16px 12px 40px; }
  .a-table { display: block; overflow-x: auto; white-space: nowrap; }
}
