:root {
  --brand:          #E60012;
  --brand-dark:     #cc0010;
  --sidebar-bg:     #1a1a2e;
  --sidebar-width:  250px;
  --sidebar-text:   #b0b0c0;
  --topbar-h:       56px;
}

/* ============================
   基本レイアウト
============================ */
body {
  background: #f0f2f5;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', Meiryo, sans-serif;
  font-size: 14px;
  color: #333;
}

/* ============================
   サイドバー
============================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease-in-out;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-icon {
  width: 38px; height: 38px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: .5px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 12px 16px 4px;
  margin: 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: all .15s;
}

.sidebar-nav .nav-link i {
  width: 22px;
  font-size: 15px;
  margin-right: 10px;
  opacity: .7;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(230,0,18,.18);
  border-left-color: var(--brand);
}

.sidebar-nav .nav-link.active i { opacity: 1; }

.sidebar-nav .disabled-link {
  opacity: .5;
  pointer-events: none;
  cursor: default;
}

.nav-ext-icon {
  font-size: 10px;
  opacity: .5;
  margin-left: auto;
  width: auto !important;
  flex-shrink: 0;
}

.nav-badge {
  font-size: 10px;
  background: var(--brand);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.nav-soon {
  font-size: 10px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.5);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-right: 10px;
}

.user-info { min-width: 0; }

.user-name {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: var(--sidebar-text); }

.btn-logout {
  display: block;
  width: 100%;
  padding: 7px;
  text-align: center;
  color: var(--sidebar-text);
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px;
  font-size: 12px;
  text-decoration: none;
  transition: all .15s;
}

.btn-logout:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ============================
   メインコンテンツ
============================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.topbar-toggle {
  background: none;
  border: none;
  font-size: 22px;
  color: #555;
  padding: 0;
  cursor: pointer;
}

.topbar-title { font-size: 15px; font-weight: 600; color: #333; }

.content-area { padding: 24px; flex: 1; }

/* ============================
   ページヘッダー
============================ */
.page-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.page-header .page-desc { color: #888; font-size: 13px; margin-top: 2px; }

/* ============================
   カード
============================ */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 20px;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================
   ブランドボタン
============================ */
.btn-brand {
  background: var(--brand);
  color: #fff;
  border: none;
}

.btn-brand:hover, .btn-brand:focus {
  background: var(--brand-dark);
  color: #fff;
}

/* ============================
   ステータスバッジ
============================ */
.badge-pending  { background: #ffc107 !important; color: #000 !important; }
.badge-approved { background: #28a745 !important; color: #fff !important; }
.badge-rejected { background: #dc3545 !important; color: #fff !important; }

/* ============================
   テーブル
============================ */
.table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  background: #f8f9fa;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
}

/* ============================
   スタット（集計）カード
============================ */
.stat-card {
  border-radius: 10px;
  padding: 20px;
  color: #fff;
  height: 100%;
}

.stat-card.red    { background: linear-gradient(135deg, #E60012, #ff4455); }
.stat-card.blue   { background: linear-gradient(135deg, #1a78c2, #4da6ff); }
.stat-card.green  { background: linear-gradient(135deg, #28a745, #48d468); }
.stat-card.orange { background: linear-gradient(135deg, #fd7e14, #ffa63a); }
.stat-card.purple { background: linear-gradient(135deg, #6f42c1, #9b7de8); }

.stat-card .stat-icon { font-size: 38px; opacity: .25; float: right; }
.stat-card .stat-number { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 12px; opacity: .85; margin-top: 6px; }

/* ============================
   準備中ページ
============================ */
.coming-soon {
  text-align: center;
  padding: 80px 30px;
}

.coming-soon .cs-icon {
  font-size: 72px;
  color: #ddd;
  display: block;
  margin-bottom: 20px;
}

.coming-soon h2 { font-size: 22px; color: #999; margin-bottom: 8px; }
.coming-soon p  { color: #bbb; }

/* ============================
   フォーム
============================ */
.form-label { font-weight: 500; }

.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(230,0,18,.15);
}

.required-mark {
  color: var(--brand);
  margin-left: 3px;
  font-size: 12px;
}

/* ============================
   ログインページ
============================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: var(--brand);
  border-radius: 14px;
  margin-bottom: 14px;
}

.login-logo-mark i { font-size: 32px; color: #fff; }

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.login-logo .login-subtitle { font-size: 13px; color: #999; }

/* ============================
   モバイルオーバーレイ
============================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}

.sidebar-overlay.show { display: block; }

/* ============================
   レスポンシブ
============================ */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .content-area { padding: 16px; }
}

/* ============================
   マイページ
============================ */
.profile-header {
  background: linear-gradient(135deg, #1a1a2e, #2a2a4e);
  border-radius: 10px;
  padding: 28px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 70px; height: 70px;
  background: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-meta { font-size: 13px; opacity: .7; }

/* ============================
   アラート
============================ */
.alert-flash { border-radius: 7px; }

/* ============================
   ポータルタイル（ダッシュボード）
============================ */
.portal-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 8px;
  background: #f8f9fa;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background .15s, transform .1s, box-shadow .15s;
  position: relative;
  min-height: 72px;
  cursor: pointer;
  border: 1px solid #eee;
}

.portal-tile i {
  font-size: 22px;
  color: var(--brand);
}

.portal-tile:hover {
  background: #fff;
  color: #111;
  box-shadow: 0 3px 10px rgba(0,0,0,.10);
  transform: translateY(-1px);
  text-decoration: none;
}

.portal-tile.disabled {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}

.portal-tile.disabled i { color: #aaa; }

.portal-tile.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: 6px; right: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
}

/* ============================
   アコーディオンナビ（社員メニュー）
   ※ JSとCSSはsidebar.phpにインライン埋め込み済み
   ※ 以下は外部ファイル版（バックアップ用、higher specificity）
============================ */
.sidebar .nav-group-body { display: none; }
.sidebar .nav-group.open > .nav-group-body { display: block; }
.sidebar .nav-group-header {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 9px 14px;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}
.sidebar .nav-group-header:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar .nav-group.open > .nav-group-header { background: rgba(255,255,255,.11); color: #fff; }
.sidebar .nav-group-chevron { margin-left: auto; font-size: 11px; transition: transform .2s ease; flex-shrink: 0; }
.sidebar .nav-group.open > .nav-group-header .nav-group-chevron { transform: rotate(180deg); }
.sidebar .nav-group-icon { font-size: 15px; opacity: .7; flex-shrink: 0; }

/* 社員ホーム：小型ステータスカード */
.status-mini-card {
  cursor: pointer;
  transition: box-shadow .12s, transform .1s;
}
.status-mini-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.13) !important;
  transform: translateY(-1px);
}
