/* ============================================================
   共通スタイル - LINE友だち追加ASP
   ============================================================ */

:root {
  --line-green: #06C755;
  --line-green-dark: #00B900;
  --ink: #1a1f2b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: #f5f7fa;
  color: var(--ink);
}

/* --- スクロールバー --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- 認証画面の背景 --- */
.auth-bg {
  min-height: 100vh;
  background: radial-gradient(circle at 15% 20%, rgba(6,199,85,0.25), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(0,185,0,0.20), transparent 45%),
              linear-gradient(160deg, #0b1220 0%, #101826 55%, #0b1220 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.98);
  border-radius: 24px;
  padding: 44px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  backdrop-filter: blur(20px);
  animation: fadeSlideUp 0.5s ease both;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-badge {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--line-green), var(--line-green-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 25px rgba(6,199,85,0.4);
  color: white; font-size: 24px;
}

.btn-line {
  background: linear-gradient(135deg, var(--line-green), var(--line-green-dark));
  color: white;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(6,199,85,0.35);
}
.btn-line:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(6,199,85,0.45); }
.btn-line:active { transform: translateY(0); }
.btn-line:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* --- アプリシェル(サイドバー+ヘッダー) --- */
.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #101826 0%, #0b1220 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  padding: 24px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  color: #94a3b8;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.nav-item.active {
  background: rgba(6,199,85,0.12);
  color: #ffffff;
  border-left-color: var(--line-green);
}
.nav-item i { width: 18px; text-align: center; }

.main-area { flex: 1; min-width: 0; }

.topbar {
  height: 72px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
}

.content { padding: 32px; max-width: 1400px; margin: 0 auto; }

/* --- KPIカード --- */
.kpi-card {
  background: white;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}

.card {
  background: white;
  border-radius: 18px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* --- テーブル --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
  text-align: left; padding: 12px 16px;
  color: #64748b; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 2px solid #f1f5f9;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }

/* --- バッジ --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-suspended { background: #f1f5f9; color: #64748b; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-unpaid { background: #fef3c7; color: #92400e; }

/* --- アバター --- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: #e2e8f0;
  border: 2px solid white; box-shadow: 0 0 0 1px #e5e7eb;
}

/* --- ボタン --- */
.btn-primary {
  background: linear-gradient(135deg, var(--line-green), var(--line-green-dark));
  color: white; font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(6,199,85,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(6,199,85,0.4); }
.btn-secondary {
  background: #f1f5f9; color: #334155; font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: 10px; transition: all 0.15s ease;
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger {
  background: #fee2e2; color: #b91c1c; font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: 8px; transition: all 0.15s ease;
}
.btn-danger:hover { background: #fecaca; }
.btn-sm {
  font-size: 13px; padding: 6px 12px; border-radius: 8px; font-weight: 600;
}

/* --- モーダル --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
  animation: fadeIn 0.15s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: white; border-radius: 20px; padding: 32px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: fadeSlideUp 0.2s ease both;
}

/* --- フォーム --- */
.form-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; transition: border-color 0.15s ease;
}
.form-input:focus { outline: none; border-color: var(--line-green); box-shadow: 0 0 0 3px rgba(6,199,85,0.12); }

/* --- リンクコードボックス --- */
.link-url-box {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px;
  padding: 8px 12px; font-family: monospace; font-size: 13px; color: #475569;
}

/* --- トースト --- */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #1e293b; color: white; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: toastIn 0.25s ease both;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* --- タブ --- */
.tab-item {
  padding: 10px 18px; font-size: 14px; font-weight: 600; color: #64748b;
  border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s ease;
}
.tab-item.active { color: var(--line-green-dark); border-bottom-color: var(--line-green); }

.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }

.loader {
  width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: var(--line-green);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- レスポンシブ --- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 40; transition: left 0.2s ease; }
  .sidebar.open { left: 0; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
}
