@charset "UTF-8";

/* ==========================================
   TSUKUYOMI スタイルシート (新レイアウト)
   ========================================== */

/* ==========================================================================
   変数定義 (Root / Variables)
   ========================================================================== */
:root {
  --primary-color: #117cf2;
  --primary-color-light: #F0F2FF;
  --primary-color-dark: #0d5dbf;
  --success-color: #2ECC71;
  --warning-color: #F39C12;
  --danger-color: #E74C3C;
  --info-color: #3498DB;

  --bg-color: #F7F8FA;
  --card-bg-color: #FFFFFF;
  --sidebar-bg: #1A202C;
  --sidebar-hover: #2D3748;

  --text-color: #1A202C;
  --text-color-light: #6B7280;
  --text-color-white: #FFFFFF;

  --border-color: #E5E7EB;
  --border-radius: 12px;

  --sidebar-width: 240px;
  --topbar-height: 60px;

  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   基本スタイル (Base Styles)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Noto Sans JP', 'Open Sans', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

/* ==========================================================================
   ログイン画面 (Login Screen)
   ========================================================================== */
#login-screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: white;
  border: 3px #117cf2 solid;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 48px 40px;
  text-align: center;
}

.login-title {
  font-size: 48px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 40px;
  letter-spacing: 3px;
}

.login-form-group {
  margin-bottom: 24px;
  text-align: left;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s;
}

.login-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.login-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #117cf2 0%, #117cf2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#login-message {
  margin-top: 20px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.login-footer {
  margin-top: 32px;
  font-size: 12px;
  color: #a0aec0;
}

/* ==========================================================================
   メインレイアウト (Main Layout)
   ========================================================================== */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   左サイドバー (Sidebar)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
}

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

.logo-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
}

.nav-link.active {
  background-color: #f0f0f0;
  color: var(--primary-color);
  font-weight: 600;
}


.nav-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 20px 0;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}


.sidebar-footer p {
  font-size: 12px;
  color: #5ba9ff;
  font-weight: 600;
}

/* ==========================================================================
   メインコンテンツエリア (Main Content) 
   ========================================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  height: 100vh;
  overflow: clip;
}

/* ==========================================================================
   中央フィルターパネル (Filter Panel)
   ========================================================================== */
.filter-panel {
  width: 280px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  transition: margin-left 0.3s ease, width 0.3s ease;
  flex-shrink: 0;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  margin-top: 82px;
  background-color: white;
}

.filter-panel.collapsed {
  margin-left: -280px;
  width: 0;
  border-right: none;
}

.filter-panel-header {
  padding: 30px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.filter-panel-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  background-color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color-light);
  transition: all 0.2s;
}

.filter-panel-toggle:hover {
  background-color: var(--bg-color);
  color: var(--text-color);
  border-color: var(--primary-color);
}

.filter-panel-toggle i {
  font-size: 14px;
  transition: transform 0.3s;
}

.filter-panel.collapsed .filter-panel-toggle i {
  transform: rotate(180deg);
}

.filter-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* フィルターセクション */
.filter-section {
  margin-bottom: 24px;
}

.filter-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: white;
  border: 1px solid transparent;
}

.filter-option:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  margin-right: 10px;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filter-option label {
  flex: 1;
  font-size: 14px;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}

.filter-option .count {
  font-size: 12px;
  color: var(--text-color-light);
  background-color: var(--bg-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.filter-option.active {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.filter-option.active label {
  color: var(--primary-color);
  font-weight: 600;
}

/* ドロップダウン選択 */
.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color-light);
  outline: none;
}

/* リセットボタン */
.filter-reset-btn {
  width: 100%;
  padding: 10px;
  background-color: #f7f8fa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.filter-reset-btn:hover {
  background-color: var(--bg-color);
  border-color: var(--text-color);
}

/* コンテンツラッパー */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

/* フィルターパネル開閉ボタン（トップバー内） */
.filter-panel-open-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 16px;
}

.filter-panel-open-btn:hover {
  background-color: var(--primary-color-dark);
}

.filter-panel-open-btn i {
  font-size: 14px;
}

/* フィルターパネルが閉じている時 */
.filter-panel.collapsed ~ .content-wrapper .filter-panel-open-btn {
  display: flex;
}

/* タブコンテンツ */
.filter-tab-content {
  display: none;
}

.filter-tab-content.active {
  display: block;
}

/* 検索ボックス */
.filter-search-box {
  position: relative;
  margin-bottom: 12px;
}

.filter-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color-light);
  font-size: 14px;
}

.filter-search-box input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  transition: all 0.2s;
}

.filter-search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color-light);
}

/* フィルターオプションリスト */
.filter-options-list {
  max-height: 450px;
  overflow-y: auto;
}

.filter-options-list::-webkit-scrollbar {
  width: 6px;
}

.filter-options-list::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 3px;
}

.filter-options-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.filter-options-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-color-light);
}

/* フィルターリストアイテム */
.filter-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.filter-list-item:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.filter-list-item.active {
  border-color: var(--primary-color);
}

.filter-list-item .item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-color);
}

.filter-list-item.active .item-name {
  color: var(--primary-color);
  font-weight: 600;
}

.filter-list-item .item-count {
  font-size: 11px;
  color: var(--text-color-light);
  background-color: var(--bg-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.filter-list-item.active .item-count {
  background-color: white;
  color: var(--primary-color);
}

/* 選択されたアイテム表示エリア */
.selected-items {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background-color: var(--primary-color-light);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  margin-bottom: 12px;
  min-height: 44px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.selected-tag i {
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.selected-tag i:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   レスポンシブ対応 (Filter Panel)
   ========================================================================== */
@media (max-width: 1024px) {
  .filter-panel {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 90;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  .filter-panel.collapsed {
    margin-left: -280px;
  }
}

/* ==========================================================================
   トップバー (Top Bar)
   ========================================================================== */
.top-bar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 41px 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color-light);
  font-size: 18px;
  transition: all 0.2s;
  position: relative;
}

.icon-button:hover {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--danger-color);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* ==========================================================================
   アカウントメニュー (Account Menu)
   ========================================================================== */
.account-menu {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background-color: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.account-button:hover {
  background-color: var(--bg-color);
  border-color: var(--primary-color);
}

.account-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.account-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button i {
  font-size: 12px;
  color: var(--text-color-light);
  transition: transform 0.2s;
}

.account-button.active i {
  transform: rotate(180deg);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--hover-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.account-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-user-info {
  flex: 1;
  min-width: 0;
}

.dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-email {
  font-size: 12px;
  color: var(--text-color-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: var(--bg-color);
}

.dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: var(--text-color-light);
}

.logout-item {
  color: var(--danger-color);
}

.logout-item i {
  color: var(--danger-color);
}

/* ==========================================================================
   コンテンツエリア (Content Area)
   ========================================================================== */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 22px;
  background-color: var(--bg-color);
}

.page-container {
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   メッセージ・アラート (Messages & Alerts)
   ========================================================================== */
.message,
.alert {
  margin: 0px 0px 20px 20px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
}

.alert-success {
  background-color: #E6F7F0;
  color: #0B8D53;
}

.alert-danger {
  background-color: #FDEBE9;
  color: #C22F1C;
}

.alert-warning {
  background-color: #FEF6E7;
  color: #D47E00;
}

.alert-info {
  background-color: #EBF5FB;
  color: #2980B9;
}

/* ==========================================================================
   セクション (Section)
   ========================================================================== */
.section {
  margin-bottom: 24px;
  padding: 24px;
  background-color: var(--card-bg-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  font-family: 'Noto Sans JP', 'Open Sans', Helvetica, Arial, sans-serif;
}

.section h3 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.section-header {
  display: flex;
  justify-content: flex-start; /* 左寄せに変更 */
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px; /* h3との間隔 */
}

.section-header h3 {
  margin-bottom: 0;
  flex-shrink: 0; /* タイトルが縮まないように */
}

/* ==========================================================================
   ボタン (Buttons)
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary,
.submit-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 16px;
  color: white;
  background-color: var(--primary-color);
}

.btn-success,
.btn-approve {
  color: white;
  background-color: var(--success-color);
}

.btn-danger,
.btn-reject {
  color: white;
  background-color: var(--danger-color);
}

.btn-warning,
.btn-hold {
  color: white;
  background-color: var(--warning-color);
}

.btn-info {
  color: white;
  background-color: var(--info-color);
}

.btn-secondary {
  color: white;
  background-color: var(--text-color-light);
}

/* ==========================================================================
   ローディング (Loading)
   ========================================================================== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  margin: 20px auto;
}

.loading span {
  width: 10px;
  height: 10px;
  margin: 0 3px;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: wave 1.2s ease-in-out infinite;
}

.loading span:nth-child(1) { animation-delay: 0s; }
.loading span:nth-child(2) { animation-delay: 0.1s; }
.loading span:nth-child(3) { animation-delay: 0.2s; }
.loading span:nth-child(4) { animation-delay: 0.3s; }
.loading span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-10px); }
  40% { transform: translateY(0); }
}

/* ==========================================================================
   ダッシュボードカード (Dashboard Cards)
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.dashboard-card {
  padding: 20px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.card-title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color-light);
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-color);
}

.card-unit {
  margin-left: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color-light);
}

/* ==========================================================================
   テーブル (Tables)
   ========================================================================== */
.table-container {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: white;
  height: 700px;
  max-height: 700px;
  min-height: 400px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* テーブルコンテナのスクロールバーを非表示 */
.table-container::-webkit-scrollbar {
    display: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color-light);
  background-color: var(--bg-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tr:hover {
  background-color: var(--bg-color);
}

/* テーブル内の社員写真 */
.data-table td .employee-photo-small,
.data-table .employee-photo-small,
.data-table td .bp-photo-small,
.data-table .bp-photo-small {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  display: block;
  margin: 0 auto;
}

/* テーブルセル内の写真セル */
.data-table td img.employee-photo-small,
.data-table td img.bp-photo-small {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px;
  min-height: 60px;
  max-width: 60px;
  max-height: 60px;
}

/* テーブルヘッダーを固定 */
.table-container thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--table-header-bg);
}


/* ==========================================================================
   フォーム (Forms)
   ========================================================================== */
input[type="date"],
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select,
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color-light);
}

/* ==========================================================================
   バッジ・タグ (Badges & Tags)
   ========================================================================== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-approved { background-color: #E6F7F0; color: #0B8D53; }
.status-pending { background-color: #FEF6E7; color: #D47E00; }
.status-rejected { background-color: #FDEBE9; color: #C22F1C; }

.status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

/* ==========================================================================
   フィルターバー (Filter Bar)
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
}

.checkbox-switch {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.checkbox-switch input {
  display: none;
}

.switch-visual {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  background-color: #fff;
  border: 1px solid #adb5bd;
  border-radius: 4px;
}

.switch-visual::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}

.checkbox-switch input:checked + .switch-visual {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.checkbox-switch input:checked + .switch-visual::after {
  opacity: 1;
}

/* ==========================================================================
   レスポンシブ (Responsive)
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  
  .sidebar-logo .logo-text,
  .nav-link span {
    display: none;
  }
  
  .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
  }
  
  .top-bar {
    padding: 0 15px;
  }
  
  .content-area {
    padding: 15px;
  }
}

/* ==========================================================================
   モーダル (Modal)
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 2% auto;
  padding: 30px 100px;
  width: 90%;
  max-width: 1200px;
  border-radius: 12px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

.modal-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.modal-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}

.modal-tab:hover {
  color: #333;
}

.modal-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h4 {
  margin-top: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
  color: #495057;
  font-size: 16px;
}

.tab-panel h4:first-child {
  margin-top: 0;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.form-row.cols-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.required {
  color: #e74c3c;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.modal-buttons .btn-danger {
  margin-right: auto;
}

/* ==========================================================================
   有給申請ページ (Employee Page)
   ========================================================================== */
.vacation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 16px;
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-align: center;
}

.stat-number {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-color-light);
}

.vacation-2column {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 30px;
  align-items: start;
}

.vacation-left,
.vacation-right {
  background-color: #f8f9fa;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.vacation-left h4,
.vacation-right h4 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
}

.vacation-right {
  min-height: 400px;
}

.date-inputs {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-input-group input[type="date"] {
  flex: 1;
}

.btn-delete-date {
  padding: 8px 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-delete-date:hover {
  background-color: #c0392b;
  transform: scale(1.05);
}

@media (max-width: 1024px) {
  .vacation-2column {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   承認ページ (Admin Page)
   ========================================================================== */
.approval-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.approval-actions .btn {
  width: 100%;
  padding: 5px;
  opacity: 0.6;
}

.approval-actions .btn.active,
.approval-actions .btn:hover {
  opacity: 1;
}

.comment-box {
  width: 100%;
  height: 60px;
}

/* ==========================================================================
   社員データページ (Employee List Page)
   ========================================================================== */
.employee-photo {
  width: 80px !important;
  height: 80px !important;
  margin-right: 12px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
}

.employee-photo.small {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.photo-toggle-btn {
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-toggle-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.filter-checkboxes {
  display: flex;
  gap: 15px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.filter-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filter-checkbox span {
  font-size: 14px;
  color: var(--text-color);
}

.gender-tag {
  font-size: 12px;
  font-weight: 600;
}

.gender-male { color: var(--primary-color); }
.gender-female { color: #e74c3c; }
.gender-other { color: #757575; }

.role-badge {
  padding: 3px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.role-admin {
  color: var(--primary-color);
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.role-user {
  color: var(--text-color-light);
  background-color: #f0f0f0;
}

.tag-work-hq { background-color: #8E44AD; }
.tag-work-active { background-color: #27AE60; }
.tag-work-standby { background-color: #F39C12; }
.tag-work-bp-active { background-color: #16A085; }
.tag-work-bp-end { background-color: #95a5a6; }
.tag-work-default { background-color: #7F8C8D; }

/* ==========================================================================
   取引先データページ (Client Data Page)
   ========================================================================== */
.text-small {
  font-size: 0.85em;
  color: #666;
  margin-top: 2px;
  line-height: 1.5;
}

.company-data-row {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-data-label {
  display: inline-block;
  padding: 3px 8px;
  background-color: #f5f5f5;
  color: #888;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  border: 1px solid #e0e0e0;
  width: 65px;
  text-align: center;
  flex-shrink: 0;
}

.company-data-value-inline {
  font-size: 0.9em;
  color: #333;
  flex: 1;
}

/* アクションアイコンボタン */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 2 0 0px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: var(--primary-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.action-icon-btn:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
  color: var(--primary-color-dark);
  transform: translateY(-2px);
}

.action-icon-btn.disabled {
  color: #ccc;
  border-color: #e8e8e8;
  cursor: not-allowed;
  pointer-events: none;
}

.action-icon-btn.disabled:hover {
  background: none;
  transform: none;
}

/* 担当者ポップアップ */
.contact-popup-container {
  display: inline-block;
  position: relative;
}

.contact-popup {
  position: absolute;
  bottom: 0px;
  left: auto;
  transform: none;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  min-width: 200px;
  max-width: 600px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  margin-left: 120px;
}

.contact-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.contact-popup-content {
  position: relative;
  z-index: 1;
  min-height: 80px;
}

.contact-card {
  transition: opacity 0.2s ease;
}

/* ナビゲーションボタン */
.contact-nav-btn {
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.contact-nav-btn:hover:not(:disabled) {
  background: var(--primary-color-dark);
  transform: scale(1.1);
}

.contact-nav-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* インジケーター */
.contact-indicator {
  display: inline-block;
  margin: 0 8px;
  font-size: 12px;
  color: #666;
  min-width: 40px;
  text-align: center;
}

.contact-current {
  font-weight: 600;
  color: var(--primary-color);
}

/* ナビゲーションコンテナ */
.contact-nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}


.dependency-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.dependency-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.dependency-name {
  padding-right: 10px;
  color: var(--text-color-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dependency-percentage {
  font-weight: 600;
  color: var(--primary-color);
  flex-shrink: 0;
}

.btn-table-edit {
  padding: 4px 8px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  margin-left: 20px;
}

.btn-table-edit:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.tag-relation-high { background-color: #8e44ad; color: white; }
.tag-relation-mid { background-color: #2980b9; color: white; }
.tag-relation-low { background-color: #16a085; color: white; }
.tag-relation-none { background-color: #7f8c8d; color: white; }

/* ==========================================================================
   売上データページ (Sales Data Page)
   ========================================================================== */
.profit-low {
  font-weight: bold;
  color: #E74C3C !important;
}

/* ==========================================================================
   社員マトリクスページ (AI Matrix Page)
   ========================================================================== */
.matrix-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.matrix-sidebar {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 20px;
}

.matrix-sidebar h4 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}

.matrix-preset-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.matrix-preset-item:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-color-light);
}

.matrix-preset-item.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color-light);
  color: var(--primary-color);
  font-weight: 600;
}

.matrix-sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.matrix-main {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.matrix-container {
  position: relative;
  width: 100%;
  height: 700px;
  background: linear-gradient(to right, #f0f0f0 1px, transparent 1px),
              linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
  background-size: 50px 50px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: white;
}

.matrix-axes {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.matrix-axis-x,
.matrix-axis-y {
  position: absolute;
  background-color: #666;
}

.matrix-axis-x {
  left: 0;
  right: 0;
  height: 2px;
  top: 50%;
  transform: translateY(-1px);
}

.matrix-axis-y {
  top: 0;
  bottom: 0;
  width: 2px;
  left: 50%;
  transform: translateX(-1px);
}

.matrix-label {
  position: absolute;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  pointer-events: none;
}

.matrix-label-top { top: 10px; left: 50%; transform: translateX(-50%); }
.matrix-label-bottom { bottom: 10px; left: 50%; transform: translateX(-50%); }
.matrix-label-left { left: 10px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; }
.matrix-label-right { right: 10px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; }

.matrix-employee {
  position: absolute;
  width: 60px;
  height: 60px;
  cursor: move;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 1;
}

.matrix-employee:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.matrix-employee.dragging {
  opacity: 0.7;
  z-index: 100;
}

.matrix-employee img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.matrix-employee-info {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.matrix-employee:hover .matrix-employee-info {
  opacity: 1;
}

/* ==========================================================================
   スクロールバー (Scrollbar)
   ========================================================================== */
.top-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 20px;
  position: sticky;
  top: 0;
  z-index: 11;
  background: white;
  margin-bottom: 5px;
    display: none;
}

.top-scrollbar-content {
  height: 1px;
}

.sticky-column {
  position: sticky;
  background: white !important;
  z-index: 8;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.data-table thead th.sticky-column {
  z-index: 12;
  background: var(--bg-color) !important;
}

.fixed-scrollbar-content {
  height: 1px;
}

/* ==========================================================================
   フローティングスクロールバー（改善版）
   ========================================================================== */

.floating-scrollbar-container {
    position: fixed;
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    max-width: 1200px;
    min-width: 400px;
    z-index: 999;
    padding: 0 20px;
}

.floating-scrollbar {
    width: 100%;
    height: 16px; /* 少し高くして掴みやすく */
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    cursor: grab;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.floating-scrollbar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.floating-scrollbar:active {
    cursor: grabbing;
}

.floating-scrollbar.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.floating-scrollbar-content {
    height: 1px;
    /* 幅はJavaScriptで動的に設定 */
}

/* スクロールバーのカスタムスタイル */
.floating-scrollbar::-webkit-scrollbar {
    height: 14px;
}

.floating-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.floating-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.98);
    cursor: pointer;
    transition: background 0.2s;
}

.floating-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark);
}

.floating-scrollbar::-webkit-scrollbar-thumb:active {
    background: #0a4a9c;
}

/* ドラッグハンドル（視覚的な目印） */
.floating-scrollbar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.4;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .floating-scrollbar-container {
        width: 30%;
    }
}

@media (max-width: 768px) {
    .floating-scrollbar-container {
        width: calc(100% - 100px);
        min-width: 250px;
        bottom: 70px;
    }
    
    .floating-scrollbar {
        height: 14px;
    }
}

@media (max-width: 480px) {
    .floating-scrollbar-container {
        width: calc(100% - 80px);
        min-width: 200px;
    }
}

/* ==========================================================================
   ページローダー (Page Loader)
   ========================================================================== */
.page-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ==========================================================================
   ユーティリティクラス (Utility Classes)
   ========================================================================== */
.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.hidden {
  display: none !important;
}

/* セクションヘッダーの選択表示エリア */
.selected-items-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1; /* 残りのスペースを使用 */
}

.filter-summary-item {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--primary-color-light);
  color: var(--primary-color);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--primary-color);
  white-space: nowrap;
}

/* 全選択アイテムのスタイル */
.filter-all-item {
  margin-bottom: 8px;
}

.filter-all-item .item-name {
  font-weight: 600;
}

.filter-all-item:hover {
  background-color: #E3F2FD;
  border-color: var(--primary-color);
}

.filter-all-item.active {
  border-color: var(--primary-color);
}

/* 既存のselected-itemsを削除 */
.selected-items {
  display: none !important;
}

/* 稼働状況タグ */
.tag-status-active {
  background-color: #d4edda;
  color: #155724;
}

.tag-status-office {
  background-color: #cce5ff;
  color: #004085;
}

.tag-status-bp {
  background-color: #fff3cd;
  color: #856404;
}

.tag-status-leave {
  background-color: #f8d7da;
  color: #721c24;
}

.tag-status-resigned {
  background-color: #e2e3e5;
  color: #383d41;
}

.tag-status-bp-end {
  background-color: #e2e3e5;
  color: #383d41;
}

/* ナビゲーショングループ */
.nav-group {
  position: relative;
}

/* サブメニュー */
.nav-submenu {
  display: none;
  padding-left: 20px;
}

.nav-group.open .nav-submenu {
  display: block !important;
}

.nav-submenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 32px;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.nav-submenu-item:hover {
  color: var(--text-color);
}

.nav-submenu-item i {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

/* サブメニューがある場合の矢印アイコン */
.nav-group > .nav-link::after {
  content: '\f107'; /* Font Awesome chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s;
}

.nav-group.open > .nav-link::after {
  transform: rotate(180deg);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .sidebar.collapsed .nav-submenu {
    display: none !important;
  }
}

/* 写真アップロードコンテナ */
.photo-upload-container {
  position: relative;
  display: inline-block;
}

.photo-upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  display: block;
}

.photo-upload-btn {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.photo-upload-btn:hover {
  background-color: var(--primary-color-dark);
  transform: scale(1.1);
}

.photo-upload-btn i {
  font-size: 14px;
}

/* 写真メニュー */
.photo-menu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 12px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: all 0.2s;
}

.photo-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.photo-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  transition: background-color 0.2s;
  text-align: left;
}

.photo-menu-item:first-child {
  border-radius: 8px 8px 0 0;
}

.photo-menu-item:last-child {
  border-radius: 0 0 8px 8px;
}

.photo-menu-item:hover {
  background-color: var(--bg-color);
}

.photo-menu-item.photo-menu-delete {
  color: #e74c3c;
}

.photo-menu-item.photo-menu-delete:hover {
  background-color: #fee;
}

.photo-menu-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}


/* =====================================
   売上データページ - 新フィルターUI用スタイル
   ===================================== */

/* フィルタートグルボタン */
.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 16px;
}

.filter-toggle-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

.filter-toggle-btn i {
    font-size: 14px;
}

/* フィルタードロップダウンパネル */
.filter-dropdown-panel {
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown-content {
    padding: 20px;
}

/* フィルターセクション */
.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* セレクトボックス */
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.filter-select:hover {
    border-color: var(--primary-color);
}

/* 検索ボックス */
.filter-search-box {
    position: relative;
    margin-bottom: 12px;
}

.filter-search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    transition: all 0.2s;
}

.filter-search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.filter-search-box input::placeholder {
    color: var(--text-color-light);
}

/* フィルターオプションリスト */
.filter-options-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
}

.filter-options-list::-webkit-scrollbar {
    width: 6px;
}

.filter-options-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.filter-options-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.filter-options-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-color-light);
}

/* フィルターリストアイテム */
.filter-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 2px 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-radius: 6px;
    background-color: white;
}

.filter-list-item:hover {
    background-color: var(--primary-color-light);
}

.filter-list-item.active {
    background-color: var(--primary-color-light);
    border: 1px solid var(--primary-color);
}

.filter-list-item .item-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-color);
}

.filter-list-item.active .item-name {
    color: var(--primary-color);
    font-weight: 600;
}

.filter-list-item .item-count {
    font-size: 11px;
    color: var(--text-color-light);
    background-color: var(--bg-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.filter-list-item.active .item-count {
    background-color: white;
    color: var(--primary-color);
}

/* 選択されたアイテムのタグ表示エリア */
.selected-items-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background-color: var(--primary-color-light);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 16px;
    min-height: 50px;
    align-items: center;
}

/* 選択されたタグ */
.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.selected-tag:hover {
    background-color: var(--primary-color-dark);
}

.selected-tag i {
    cursor: pointer;
    font-size: 11px;
    padding: 3px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.selected-tag i:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* フィルターアクションボタンエリア */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-secondary {
    color: var(--text-color);
    background-color: #E5E7EB;
}

.btn-secondary:hover {
    background-color: #D1D5DB;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .filter-toggle-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .filter-dropdown-content {
        padding: 15px;
    }
    
    .selected-tag {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ==========================================================================
   フローティング追加ボタン (Floating Add Button)
   ========================================================================== */
.floating-add-btn {
    position: fixed;
    bottom: 30px;
    right: 5%;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(17, 124, 242, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-add-btn:hover {
    background: var(--primary-color-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(17, 124, 242, 0.5);
}

.floating-add-btn:active {
    transform: scale(0.95);
}

/* ダッシュボードトグルボタン */
.dashboard-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 44px;
    height: 30px;
}

.dashboard-toggle-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.dashboard-toggle-btn.active {
    background-color: var(--primary-color);
}

.dashboard-toggle-btn.active:hover {
    background-color: var(--primary-color-dark);
}

.dashboard-grid {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 200px;
    opacity: 1;
}

.dashboard-grid.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding: 0;
}

@media (max-width: 1280px) {
  .table-container {
    height: 600px;
    max-height: 600px;
  }
}
/* ==========================================================================
   テーブル内タグ表示 (Table Tag Display)
   ========================================================================== */

/* タグリストセル */
/* タグリストセル (縦並び) */
.tag-list-cell {
    padding: 12px 16px !important;
    vertical-align: top !important;
    max-width: none;
}

.tag-list-cell .tag-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}


/* 表示用タグアイテム (×ボタンなし) */
.tag-item-display {
    display: inline-block;
    padding: 6px 12px;
    background: #1380eede;
    color: white;
    border-radius: 16px;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}

.tag-item-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}