/**
 * 旅行会社業務プラットフォーム Demo 共享テーマ
 * 訪日旅行テーマ：朱赤 + ディープインディゴ + 桜ピンク + ゴールド
 */

:root {
  /* ブランド色 */
  --jp-red: #d32f4f;
  --jp-red-dark: #b3233f;
  --jp-indigo: #1e3a5f;
  --jp-indigo-light: #2c5282;
  --sakura: #ffb7c5;
  --sakura-light: #fce7ec;
  --gold: #e8b04b;
  --gold-light: #fdf3e0;

  /* 中性色 */
  --slate-950: #0f172a;
  --slate-900: #1e293b;
  --slate-800: #334155;
  --slate-700: #475569;
  --slate-600: #64748b;
  --slate-500: #94a3b8;
  --slate-400: #cbd5e1;
  --slate-300: #e2e8f0;
  --slate-200: #f1f5f9;
  --slate-100: #f8fafc;
  --slate-50: #fbfcfd;

  /* 機能色 */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --danger: #dc2626;
  --danger-bg: #fee2e2;

  /* レイアウト */
  --sidebar-w: 240px;
  --header-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);

  /* フォント */
  --font: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--slate-800);
  background: var(--slate-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── 共通ボタン ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-xs); font-weight: 700; font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--jp-red); color: #fff; box-shadow: 0 4px 14px rgba(211,47,79,.3); }
.btn-primary:hover { background: var(--jp-red-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(211,47,79,.4); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); }
.btn-outline { background: #fff; color: var(--jp-indigo); border: 1px solid var(--slate-300); }
.btn-outline:hover { border-color: var(--jp-red); color: var(--jp-red); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── バッジ ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-slate { background: var(--slate-200); color: var(--slate-700); }
.badge-sakura { background: var(--sakura-light); color: var(--jp-red); }

/* ── 「demo未公開」トースト ── */
#demo-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(120px);
  background: var(--slate-900); color: #fff; padding: 14px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 9999;
  display: flex; align-items: center; gap: 10px; opacity: 0;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s ease; pointer-events: none;
}
#demo-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#demo-toast::before { content: '🔒'; font-size: 18px; }

/* ── 管理系共通レイアウト（admin / agent） ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--slate-950); color: var(--slate-300);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-brand {
  height: var(--header-h); display: flex; align-items: center; gap: 10px; padding: 0 20px;
  color: #fff; font-weight: 800; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-dot {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--jp-red), var(--sakura));
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-group-label {
  padding: 14px 22px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate-500);
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: var(--slate-400);
  font-size: 14px; font-weight: 500; transition: all .15s ease; border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-link.active { background: rgba(211,47,79,.12); color: #fff; border-left-color: var(--jp-red); }
.sidebar-link .ico { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-link.locked::after { content: '🔒'; margin-left: auto; font-size: 11px; opacity: .5; }
.sidebar-link.active.locked::after { opacity: .6; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--slate-900); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--jp-indigo), var(--jp-red));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.content { padding: 28px; flex: 1; }
.menu-toggle { display: none; font-size: 22px; color: var(--slate-700); }

/* ── 統計カード ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200); position: relative; overflow: hidden;
}
.stat-card .label { font-size: 13px; color: var(--slate-600); font-weight: 600; }
.stat-card .value { font-size: 30px; font-weight: 800; color: var(--slate-900); margin-top: 6px; letter-spacing: -.02em; }
.stat-card .delta { font-size: 12px; font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; }
.stat-card .delta.up { color: var(--success); }
.stat-card .delta.down { color: var(--danger); }
.stat-card .ico-bg {
  position: absolute; right: -8px; bottom: -8px; font-size: 64px; opacity: .08;
}

/* ── パネル ── */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--slate-200); }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--slate-900); }
.panel-body { padding: 22px; }

/* ── テーブル ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 12px 16px; background: var(--slate-100); color: var(--slate-600);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  border-bottom: 1px solid var(--slate-200);
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--slate-200); color: var(--slate-700); white-space: nowrap; }
table.data tr:hover td { background: var(--slate-50); }
table.data td.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--slate-900); }

/* ── チャート（CSS製） ── */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 60%; max-width: 42px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--jp-red), var(--sakura)); position: relative; transition: height .4s ease; }
.bar.alt { background: linear-gradient(180deg, var(--jp-indigo), var(--jp-indigo-light)); }
.bar-label { font-size: 12px; color: var(--slate-600); font-weight: 600; }
.bar-val { font-size: 11px; color: var(--slate-700); font-weight: 700; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); }

.donut { width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; }
.donut::after { content: ''; position: absolute; width: 100px; height: 100px; background: #fff; border-radius: 50%; }
.donut-center { position: relative; z-index: 2; text-align: center; }
.donut-center .big { font-size: 24px; font-weight: 800; color: var(--slate-900); }
.donut-center .small { font-size: 11px; color: var(--slate-600); }

/* ── レスポンシブ ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 18px; }
}
