/* ============================================================
   shop_common.css — 加盟店管理システム共通スタイル v2
   テーマ: 業務系・青系フォーマル
   PC中心（≥1024px）・モバイル崩れなし
   ============================================================ */

/* ---------- CSS 変数 ---------- */
:root {
  --primary:             #1D4ED8;
  --primary-mid:         #3B82F6;
  --primary-light:       #DBEAFE;
  --primary-xlight:      #EFF6FF;
  --primary-dark:        #1E3A8A;
  --secondary:           #0891B2;
  --success:             #059669;
  --success-light:       #D1FAE5;
  --warning:             #D97706;
  --warning-light:       #FEF3C7;
  --danger:              #DC2626;
  --danger-light:        #FEE2E2;
  --bg:                  #F1F5F9;
  --bg-card:             #FFFFFF;
  --bg-muted:            #F8FAFF;
  --bg-sidebar:          #1E293B;
  --bg-sidebar-hover:    #334155;
  --bg-sidebar-active:   #1D4ED8;
  --text-main:           #0F172A;
  --text-sub:            #475569;
  --text-light:          #94A3B8;
  --text-sidebar:        #CBD5E1;
  --text-sidebar-active: #FFFFFF;
  --border:              #E2E8F0;
  --border-strong:       #CBD5E1;
  --border-focus:        #3B82F6;
  --shadow-sm:           0 1px 4px rgba(0,0,0,.07);
  --shadow:              0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:           0 8px 32px rgba(0,0,0,.13);
  --shadow-blue:         0 4px 20px rgba(29,78,216,.18);
  --radius:              8px;
  --radius-lg:           12px;
  --font:                'Hiragino Kaku Gothic ProN', 'Meiryo', 'Yu Gothic', sans-serif;
  --transition:          .18s ease-out;
  --sidebar-w:           240px;
}

/* ---------- リセット・ベース ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ---------- ヘッダー ---------- */
.s-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.s-header::after {
  content: '';
  display: block; height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-mid) 50%, transparent 100%);
}
.s-header__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 16px;
}
.s-header__logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; color: var(--primary); font-size: .975rem;
  text-decoration: none; flex-shrink: 0;
}
.s-header__logo:hover { text-decoration: none; color: var(--primary-dark); }
.s-header__logo-icon { font-size: 1.25rem; }
.s-header__logo-sub {
  font-size: .7rem; font-weight: 500; color: var(--text-light);
  background: var(--primary-xlight); border: 1px solid var(--primary-light);
  border-radius: 4px; padding: 1px 6px; margin-left: 2px;
}
.s-header__nav { display: flex; gap: 2px; flex: 1; }
.s-header__nav-link {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; color: var(--text-sub);
  transition: background var(--transition), color var(--transition);
}
.s-header__nav-link:hover { background: var(--primary-xlight); color: var(--primary); text-decoration: none; }
.s-header__nav-link.is-active {
  background: var(--primary-light); color: var(--primary);
  font-weight: 700;
}
.s-header__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.s-header__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-mid); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.s-header__user {
  font-size: .8375rem; color: var(--text-sub);
  white-space: nowrap; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis;
}
.s-header__logout {
  padding: 5px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .8125rem; font-weight: 600;
  color: var(--text-sub);
  transition: border-color var(--transition), color var(--transition);
}
.s-header__logout:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.s-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------- ページヘッダー ---------- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header__title { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; }
.page-header__sub   { font-size: .875rem; color: var(--text-sub); margin-top: 3px; }
.page-header__sub a { color: var(--text-sub); }
.page-header__sub a:hover { color: var(--primary); }
.page-header__breadcrumb-sep { margin: 0 6px; color: var(--border-strong); }

/* ---------- カード ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: box-shadow var(--transition);
}
.card--hover { cursor: pointer; }
.card--hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.card__title {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; color: var(--text-main);
}
.card__title-right { margin-left: auto; }

/* ---------- セクションラベル ---------- */
.section-label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-light);
  margin-bottom: 14px;
}

/* ---------- KPI カード ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px 18px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
}
.kpi-card__icon { font-size: 1.375rem; margin-bottom: 10px; }
.kpi-card__label { font-size: .75rem; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; letter-spacing: .02em; }
.kpi-card__value { font-size: 1.875rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.kpi-card__value--danger { color: var(--danger); }
.kpi-card__value--success { color: var(--success); }
.kpi-card__delta { font-size: .8rem; color: var(--text-sub); margin-top: 6px; }

/* ---------- クイックナビカード ---------- */
.quick-nav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.quick-nav-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.quick-nav-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--primary-light); text-decoration: none; }
.quick-nav-card__icon { font-size: 1.875rem; margin-bottom: 10px; }
.quick-nav-card__title { font-size: .9375rem; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.quick-nav-card__desc { font-size: .8125rem; color: var(--text-sub); }

/* ---------- 店舗ステータスヒーロー ---------- */
.shop-hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px;
  color: #fff; box-shadow: var(--shadow-blue);
}
.shop-hero__icon { font-size: 2rem; flex-shrink: 0; }
.shop-hero__info { flex: 1; min-width: 0; }
.shop-hero__name { font-size: 1.125rem; font-weight: 800; }
.shop-hero__meta { font-size: .85rem; opacity: .85; margin-top: 2px; }
.shop-hero__copy { font-size: .8rem; opacity: .75; margin-top: 4px; }

/* ---------- 通知リスト ---------- */
.notification-list { display: flex; flex-direction: column; }
.notification-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.notification-item:last-child { border-bottom: none; }
.notification-item__avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  background: var(--primary-light);
}
.notification-item__avatar--read { background: var(--bg); }
.notification-item__body { flex: 1; min-width: 0; }
.notification-item__title { font-size: .9rem; font-weight: 700; margin-bottom: 2px; }
.notification-item__title--read { font-weight: 400; }
.notification-item__text { font-size: .8125rem; color: var(--text-sub); }
.notification-item__time { font-size: .75rem; color: var(--text-light); margin-top: 4px; }
.notification-item__dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; flex-shrink: 0; margin-top: 6px; }

/* ---------- 店舗カード（一覧） ---------- */
.shop-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 0;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.shop-card:hover { box-shadow: var(--shadow); border-color: var(--primary-light); }
.shop-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.shop-card__name-wrap { display: flex; align-items: flex-start; gap: 10px; }
.shop-card__type-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 1px; }
.shop-card__name { font-weight: 700; font-size: .9375rem; line-height: 1.3; }
.shop-card__meta { font-size: .75rem; color: var(--text-sub); margin-top: 2px; }
.shop-card__catch {
  font-size: .85rem; color: var(--text-sub); margin-bottom: 10px;
  border-left: 3px solid var(--primary-light); padding-left: 10px;
}
.shop-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.shop-card__tag {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 2px 9px; border-radius: 999px; font-size: .775rem; font-weight: 600;
}
.shop-card__tag--owner { background: var(--primary-xlight); color: var(--primary); border: 1px solid var(--primary-light); }
.shop-card__rating { color: var(--warning); font-size: .8375rem; font-weight: 600; }
.shop-card__address { font-size: .8125rem; color: var(--text-sub); margin-bottom: 12px; }
.shop-card__footer { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.s-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.s-table th {
  padding: 10px 16px; background: var(--bg);
  border-bottom: 2px solid var(--border-strong);
  text-align: left; font-size: .8rem; font-weight: 700;
  color: var(--text-sub); white-space: nowrap; letter-spacing: .03em;
}
.s-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.s-table tr:last-child td { border-bottom: none; }
.s-table tr:hover td { background: var(--bg-muted); }
.s-table .td-name { font-weight: 600; line-height: 1.3; }
.s-table .td-sub { font-size: .775rem; color: var(--text-sub); margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.s-table .td-right { text-align: right; }
.s-table .td-center { text-align: center; }
.s-table .td-nowrap { white-space: nowrap; }
.s-table .td-price { font-weight: 700; }
.s-table .td-price-original { font-size: .775rem; color: var(--text-light); text-decoration: line-through; }
.s-table .td-actions { white-space: nowrap; text-align: center; }

/* テーブルカウント行 */
.table-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  font-size: .8125rem; color: var(--text-sub);
}
.table-meta__count strong { color: var(--primary); font-size: .9375rem; }

/* ---------- バッジ ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge-pending   { background: var(--warning-light); color: #92400E; border: 1px solid rgba(217,119,6,.2); }
.badge-reviewing { background: var(--primary-light);  color: var(--primary-dark); border: 1px solid rgba(59,130,246,.2); }
.badge-approved  { background: var(--success-light);  color: #065F46; border: 1px solid rgba(5,150,105,.2); }
.badge-rejected  { background: var(--danger-light);   color: #991B1B; border: 1px solid rgba(220,38,38,.2); }
.badge-active    { background: var(--success-light);  color: #065F46; border: 1px solid rgba(5,150,105,.2); }
.badge-suspended { background: var(--danger-light);   color: #991B1B; border: 1px solid rgba(220,38,38,.2); }
.badge-stock-ok  { background: var(--success-light);  color: #065F46; border: 1px solid rgba(5,150,105,.15); }
.badge-stock-low { background: var(--warning-light);  color: #92400E; border: 1px solid rgba(217,119,6,.15); }
.badge-stock-out { background: var(--danger-light);   color: #991B1B; border: 1px solid rgba(220,38,38,.15); }

/* ---------- 業態チップ ---------- */
.type-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; font-weight: 600; padding: 2px 9px;
  border-radius: 4px; white-space: nowrap;
}
.type-chip--restaurant { background: #FEF3C7; color: #92400E; border: 1px solid rgba(217,119,6,.2); }
.type-chip--salon      { background: #FCE7F3; color: #9D174D; border: 1px solid rgba(236,72,153,.2); }
.type-chip--product    { background: #EDE9FE; color: #5B21B6; border: 1px solid rgba(99,102,241,.2); }

/* ---------- フォーム ---------- */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.form-label { font-size: .8125rem; font-weight: 600; color: var(--text-sub); }
.form-required { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9375rem; font-family: var(--font); color: var(--text-main);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-control.is-error { border-color: var(--danger); }
.form-control.is-error:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-note { font-size: .75rem; color: var(--text-light); margin-top: 4px; }
.form-error-msg { font-size: .8rem; color: var(--danger); margin-top: 3px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.form-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; cursor: pointer; margin-top: 6px;
}
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }

/* フォームグリッド */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.form-grid--tight { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-group--full { grid-column: 1 / -1; }

/* ---------- フィルタバー ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-bar__item { display: flex; flex-direction: column; gap: 3px; }
.filter-bar__label { font-size: .775rem; font-weight: 600; color: var(--text-sub); }
.filter-bar__actions { display: flex; gap: 6px; align-items: flex-end; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-size: .9375rem;
  font-weight: 600; border: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap; cursor: pointer; font-family: var(--font);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,.25);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(29,78,216,.3); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-xlight); color: var(--primary); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-sub); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--border-strong); color: var(--text-main); }
.btn-sm { padding: 6px 13px; font-size: .8125rem; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius); }

/* ---------- アラート ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 18px;
}
.alert-success { background: var(--success-light); border: 1px solid #6EE7B7; color: #065F46; }
.alert-danger  { background: var(--danger-light);  border: 1px solid #FECACA; color: #DC2626; }
.alert-warning { background: var(--warning-light); border: 1px solid #FCD34D; color: #92400E; }
.alert-info    { background: var(--primary-light); border: 1px solid #93C5FD; color: var(--primary-dark); }

/* ---------- 空状態 ---------- */
.empty-state {
  text-align: center; padding: 48px 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.empty-state__icon { font-size: 2.75rem; margin-bottom: 14px; opacity: .6; }
.empty-state__title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.empty-state__text { color: var(--text-sub); font-size: .9rem; }

/* ---------- セクションヘッダー ---------- */
.section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 700; color: var(--primary);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

/* ---------- デモ通知 ---------- */
.demo-notice {
  background: var(--warning-light); border: 1px solid #FCD34D;
  border-radius: var(--radius); padding: 10px 14px;
  font-size: .8rem; color: #92400E; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- フッター ---------- */
.s-footer {
  text-align: center; padding: 20px 16px;
  font-size: .75rem; color: var(--text-light);
  border-top: 1px solid var(--border);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 767px) {
  .s-header__inner { padding: 0 16px; gap: 10px; }
  .s-header__nav { gap: 0; }
  .s-header__nav-link { padding: 5px 8px; font-size: .8rem; }
  .s-header__user { display: none; }
  .s-wrap { padding: 20px 16px 48px; }
  .kpi-grid { gap: 10px; }
  .page-header__title { font-size: 1.2rem; }
  .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar__item input, .filter-bar__item select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .s-table th, .s-table td { padding: 9px 10px; }
}
@media (min-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-nav-grid { grid-template-columns: repeat(3, 1fr); }
}
