/* ═══════════════════════════════════════════════════════════
   Fukumi Portal — グローバルスタイル
   Cloud Run 版ポータルの共通CSS。
   WCAG準拠・高コントラスト・明るい配色を基本とする。
   ═══════════════════════════════════════════════════════════ */

/* ── リセット & 基本 ────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #1e293b;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: 0;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════
   ナビゲーション — 上部固定バー
   ═══════════════════════════════════════════ */
.fkp-portal-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.fkp-nav-top {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
}

/* ブランド */
.fkp-nav-brand {
  flex-shrink: 0;
  margin-right: 16px;
}
.fkp-brand-link {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.fkp-brand-link i {
  color: #2563eb;
  margin-right: 4px;
}

/* モジュールタブ */
.fkp-nav-modules {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fkp-nav-modules::-webkit-scrollbar { display: none; }

.fkp-nav-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none !important;
}
.fkp-nav-tab:hover {
  background: #f1f5f9;
  color: #1e293b;
  text-decoration: none !important;
}
.fkp-nav-tab--active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}
.fkp-nav-tab i {
  font-size: 12px;
}

/* ユーザー */
.fkp-nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}
.fkp-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
}
.fkp-user-name {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fkp-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #94a3b8 !important;
  text-decoration: none !important;
  transition: all 0.15s ease;
}
.fkp-logout-btn:hover {
  background: #fef2f2;
  color: #ef4444 !important;
}

/* サブナビ */
.fkp-nav-sub {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 4px 16px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid #f1f5f9;
}
.fkp-nav-sub::-webkit-scrollbar { display: none; }

.fkp-sub-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  border-radius: 4px;
  transition: all 0.15s ease;
  text-decoration: none !important;
}
.fkp-sub-tab:hover {
  background: #f1f5f9;
  color: #334155;
}
.fkp-sub-tab--active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}
.fkp-sub-tab i {
  font-size: 10px;
}

/* ═══════════════════════════════════════════
   ポータルTOP — ランディングカード
   ═══════════════════════════════════════════ */
.fkp-top-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.fkp-top-hero {
  text-align: center;
  margin-bottom: 48px;
}
.fkp-top-title {
  font-size: 32px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}
.fkp-top-title i {
  color: #2563eb;
}
.fkp-top-subtitle {
  font-size: 15px;
  color: #64748b;
}

.fkp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.fkp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.fkp-card:hover {
  border-color: var(--card-color, #2563eb);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.fkp-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 20px;
}

.fkp-card-body {
  flex: 1;
  min-width: 0;
}
.fkp-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}
.fkp-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.fkp-card-arrow {
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 14px;
  transition: all 0.2s ease;
}
.fkp-card:hover .fkp-card-arrow {
  color: var(--card-color, #2563eb);
  transform: translateX(3px);
}

/* ═══════════════════════════════════════════
   エラーページ
   ═══════════════════════════════════════════ */
.fkp-error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
}
.fkp-error-icon {
  font-size: 64px;
  color: #f59e0b;
  margin-bottom: 24px;
}
.fkp-error-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.fkp-error-detail {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 32px;
  word-break: break-all;
}
.fkp-error-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #2563eb;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s ease;
}
.fkp-error-back:hover {
  background: #1d4ed8;
}

/* ═══════════════════════════════════════════
   フッター
   ═══════════════════════════════════════════ */
.fkp-footer {
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-size: 12px;
  border-top: 1px solid #e2e8f0;
  margin-top: 64px;
}

/* ═══════════════════════════════════════════
   レスポンシブ
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .fkp-nav-tab span,
  .fkp-user-name {
    display: none;
  }
  .fkp-nav-tab {
    padding: 8px;
  }
  .fkp-top-title {
    font-size: 24px;
  }
  .fkp-card-grid {
    grid-template-columns: 1fr;
  }
}
