/* EQ加盟店売上管理システム — Phase 0 スタイル */

body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; background:#f4f6f9; margin:0; }

/* ── サイドバー ───────────────────────── */
.sidebar {
  width: 230px;
  min-height: 100vh;
  background: #2c3e50;
  color: #fff;
  position: fixed;
  top: 0; left: 0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  /* overflow設定なし(visible) = popoutが sidebar右辺の外側に正しく展開される */
  z-index: 2000;  /* main内のsticky要素(z-index:10/12)より上位の stacking context を確保 */
}
.sidebar .brand { padding: 0 1.25rem 1rem; border-bottom: 1px solid #3d5165; }
.sidebar .brand-title { font-size: 1rem; font-weight: 600; }
.sidebar .brand-sub { font-size: .7rem; color: #9ab; }
.sidebar .nav-link {
  color: #cfd8dc; padding: .35rem 1.25rem;   /* .65rem → .35rem 圧縮 */
  text-decoration: none;
  display: flex; align-items: center; gap: .5rem;
  font-size: .88rem;
  border: none; background: transparent;
}
.sidebar .nav-link:hover { background: #34495e; color: #fff; }
.sidebar .nav-link.active { background: #1abc9c; color: #fff; }
.sidebar .section-title {
  color: #7f9ba6; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 1rem 1.25rem .25rem;
}
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid #3d5165;
  font-size: .8rem;
}
.sidebar-footer .user-info { color: #cfd8dc; margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.sidebar-footer .logout-link { color: #9ab; text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.sidebar-footer .logout-link:hover { color: #fff; }

/* ── メインコンテンツ ───────────────────── */
.main {
  margin-left: 230px;
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-title { font-size: 1.4rem; font-weight: 600; margin: 0; }

.badge-phase { background: #e8f5e9; color: #2e7d32; font-size: .7rem; padding: .25em .6em; border-radius: .25rem; font-weight: 600; }

/* ── 共通カード ─────────────────────────── */
.stat-card { background: #fff; border-radius: .5rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); height: 100%; }
.stat-label { color: #7f8c8d; font-size: .8rem; margin-bottom: .25rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: #2c3e50; }
.stat-trend { font-size: .8rem; margin-top: .25rem; }
.stat-trend.up { color: #27ae60; }
.stat-trend.down { color: #e74c3c; }

.card-block { background: #fff; border-radius: .5rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 1rem; }
.card-block h5 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #34495e; }

/* ── プラットフォーム識別 ────────────────── */
.platform-chip { font-size: .7rem; padding: .2em .5em; border-radius: .25rem; color: #fff; }
.platform-uber_eats { background: #06C167; }  /* 緑 (Uber公式) */
.platform-rocketnow { background: #2196F3; }  /* 青 */
.platform-demaecan  { background: #E60012; }  /* 赤 */
.platform-menu      { background: #E91E63; }  /* ピンク */

/* ── テーブル ────────────────────────────── */
table.tight th, table.tight td { font-size: .85rem; padding: .5rem .75rem; }

/* ── アップロードゾーン ───────────────────── */
.upload-zone {
  border: 2px dashed #bdc3c7;
  border-radius: .5rem;
  padding: 2rem;
  text-align: center;
  color: #7f8c8d;
  background: #fafbfc;
}

/* ── 共通アクセサリ ───────────────────────── */
.small-muted { font-size: .75rem; color: #95a5a6; }
.ribbon {
  background: #fff3cd; border: 1px solid #ffe69c;
  color: #664d03; padding: .5rem .75rem; border-radius: .25rem;
  font-size: .8rem; margin-bottom: 1rem;
}

/* ── ログイン画面 ─────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: #2c3e50;
}
.login-card {
  background: #fff; border-radius: .5rem; padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  width: 100%; max-width: 380px;
}
.login-card h1 { font-size: 1.2rem; margin: 0 0 .25rem; color: #2c3e50; }
.login-card .sub { color: #95a5a6; font-size: .85rem; margin-bottom: 1.5rem; }

/* ── ヘルパー ──────────────────────────────── */
.text-right { text-align: right; }

/* ══════════════════════════════════════════════════════════════════════
   2026-07-21 タスク#446: merchant ロール スマホ 対応 (=768px 以下)
   ══════════════════════════════════════════════════════════════════════ */
/* ハンバーガー ボタン / オーバーレイ = デフォルト 非表示 (=デスクトップ) */
.mobile-menu-btn { display: none; }
.mobile-overlay  { display: none; }

@media (max-width: 768px) {
  /* ─── merchant ロール のみ 対象 (=admin は 従来 デスクトップ 前提) ─── */
  body.role-merchant .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.35);
    width: 260px;
  }
  body.role-merchant .sidebar.open {
    transform: translateX(0);
  }
  body.role-merchant .main {
    margin-left: 0 !important;
    padding: 64px 12px 16px;   /* top = ハンバーガー ボタン 高さ 分 */
  }
  body.role-merchant .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px; left: 10px;
    z-index: 3100;
    background: #2c3e50;
    color: #fff;
    border: none;
    width: 44px; height: 44px;
    border-radius: 6px;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: pointer;
    padding: 0;
  }
  body.role-merchant .mobile-menu-btn:active,
  body.role-merchant.menu-open .mobile-menu-btn {
    background: #1abc9c;
  }
  body.role-merchant .mobile-overlay.open {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1900;   /* sidebar (z-index:2000) より 下 に 敷く */
  }
  body.role-merchant.menu-open {
    overflow: hidden;   /* スクロール ロック */
  }
  /* テーブル 横 スクロール = Bootstrap .table のみ 対象 (=chart canvas 影響 なし) */
  body.role-merchant .main .table-responsive-sm,
  body.role-merchant .main table.table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* カード の 余白 圧縮 (=画面幅 有効利用) */
  body.role-merchant .main .card-block,
  body.role-merchant .main .stat-card {
    padding: 0.75rem;
  }
  body.role-merchant .main .stat-value {
    font-size: 1.3rem;
  }
  /* 大きい 見出し は 少し 縮小 */
  body.role-merchant .main h1,
  body.role-merchant .main .page-title {
    font-size: 1.2rem;
  }
  body.role-merchant .main h2 { font-size: 1.05rem; }
  /* Bootstrap grid = 縦 積み 前提 (=col-md-* は 元々 md 以上 で 横並び = OK) */
}
