/* =============================================
   BBG経営ダッシュボード - スタイルシート
   カラースキーム：ダーク系
   ============================================= */

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

:root {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --accent: #0f3460;
  --highlight: #e94560;
  --text: #eeeeee;
  --subtext: #999999;
  --plus: #4ecca3;
  --minus: #e94560;
  --border: #1e3a6e;
  --hover: #1e2f5a;
  --warning: #f5a623;
  --success: #4ecca3;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
               'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* =============================================
   ヘッダー
   ============================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  font-size: 24px;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

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

.current-month {
  font-size: 16px;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.month-nav-btn {
  background: var(--accent);
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.month-nav-btn:hover {
  background: var(--highlight);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-select {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--subtext);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--highlight);
  color: var(--highlight);
}

/* =============================================
   タブナビゲーション
   ============================================= */

.tab-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  padding: 0 12px;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--subtext);
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--highlight);
}

/* =============================================
   メインコンテンツ
   ============================================= */

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

.tab-panel {
  display: none;
}

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

/* =============================================
   KPIカード
   ============================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: var(--accent);
}

.kpi-label {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--subtext);
}

.kpi-sub.positive {
  color: var(--plus);
}

.kpi-sub.negative {
  color: var(--minus);
}

/* =============================================
   セクション
   ============================================= */

.section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

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

.subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--subtext);
  margin: 16px 0 8px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-toolbar label {
  color: var(--subtext);
  font-size: 13px;
}

/* =============================================
   グリッドレイアウト
   ============================================= */

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   テーブル
   ============================================= */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.data-table th {
  background: var(--accent);
  color: var(--subtext);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.data-table th.num {
  text-align: right;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.data-table tfoot td {
  background: var(--accent);
  font-weight: 700;
  border-top: 2px solid var(--border);
  padding: 12px;
}

/* =============================================
   ボタン
   ============================================= */

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

.btn-primary:hover {
  background: #c73652;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-ghost:hover {
  border-color: var(--text);
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-success {
  background: var(--plus);
  border: none;
  color: #1a1a2e;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

/* =============================================
   フォーム
   ============================================= */

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

.form-label {
  display: block;
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--highlight);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.filter-select {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 24px 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--highlight);
}

/* =============================================
   プログレスバー
   ============================================= */

.progress-bar-wrap {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--plus);
  transition: width 0.5s ease;
}

.progress-bar-fill.warning {
  background: var(--warning);
}

.progress-bar-fill.danger {
  background: var(--minus);
}

/* =============================================
   KPI概況 - 残高予測
   ============================================= */

.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forecast-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.forecast-company {
  width: 80px;
  font-size: 12px;
  color: var(--subtext);
  flex-shrink: 0;
}

.forecast-bar-container {
  flex: 1;
  min-width: 200px;
}

.forecast-bar-track {
  height: 24px;
  background: var(--accent);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.forecast-bar-current {
  height: 100%;
  background: var(--plus);
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #1a1a2e;
  transition: width 0.5s ease;
}

.forecast-bar-projected {
  height: 100%;
  background: var(--minus);
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 11px;
  color: white;
  transition: width 0.5s ease;
}

.forecast-values {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.forecast-current {
  color: var(--plus);
}

.forecast-projected {
  color: var(--minus);
}

/* 残高予測（出費予定タブ） */
.balance-forecast-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.forecast-item {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.forecast-label {
  display: block;
  font-size: 11px;
  color: var(--subtext);
  margin-bottom: 4px;
}

.forecast-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.forecast-value.negative {
  color: var(--minus);
}

.forecast-arrow {
  font-size: 20px;
  color: var(--subtext);
}

/* =============================================
   今日の予定ミニリスト
   ============================================= */

.schedule-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-item-mini {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent);
}

.schedule-item-mini .time {
  font-size: 12px;
  color: var(--subtext);
  white-space: nowrap;
  min-width: 60px;
}

.schedule-item-mini .title {
  font-size: 13px;
  color: var(--text);
}

.schedule-item-mini.work {
  border-left: 3px solid #4e9aff;
}

.schedule-item-mini.private {
  border-left: 3px solid var(--plus);
}

.schedule-item-mini.all-day {
  border-left: 3px solid var(--warning);
}

.no-data {
  color: var(--subtext);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* =============================================
   経費アラート
   ============================================= */

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.alert-item.danger {
  background: rgba(233,69,96,0.15);
  border: 1px solid rgba(233,69,96,0.3);
  color: var(--minus);
}

.alert-item.warning {
  background: rgba(245,166,35,0.15);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--warning);
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--subtext);
}

.progress-item-label {
  color: var(--text);
}

/* =============================================
   残高タブ
   ============================================= */

.company-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.company-tab-btn {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--subtext);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.company-tab-btn.active {
  background: var(--highlight);
  border-color: var(--highlight);
  color: white;
}

.balance-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.balance-total-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.balance-total-label {
  font-size: 13px;
  color: var(--subtext);
}

.balance-total-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--plus);
}

.balance-diff {
  font-size: 13px;
  color: var(--subtext);
}

.balance-diff.positive {
  color: var(--plus);
}

.balance-diff.negative {
  color: var(--minus);
}

.account-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.account-card:hover {
  border-color: var(--highlight);
  transform: translateY(-1px);
}

.account-card.active {
  border-color: var(--highlight);
}

.account-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.account-card-bank {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 12px;
}

.account-card-balance {
  font-size: 24px;
  font-weight: 700;
  color: var(--plus);
}

.account-card-meta {
  font-size: 11px;
  color: var(--subtext);
  margin-top: 4px;
}

/* =============================================
   CA報告リスト
   ============================================= */

.ca-report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ca-report-item {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.ca-report-date {
  font-size: 12px;
  color: var(--subtext);
  white-space: nowrap;
}

.ca-report-info {
  flex: 1;
}

.ca-report-staff {
  font-weight: 600;
  font-size: 13px;
}

.ca-report-store {
  font-size: 12px;
  color: var(--subtext);
}

.ca-report-detail {
  font-size: 12px;
  color: var(--subtext);
  margin-top: 4px;
}

.ca-report-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--plus);
  text-align: right;
  white-space: nowrap;
}

/* =============================================
   週間カレンダー
   ============================================= */

.schedule-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .weekly-calendar {
    grid-template-columns: 1fr;
  }
}

.week-day-column {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 100px;
}

.week-day-header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--subtext);
}

.week-day-header.today {
  color: var(--highlight);
}

.week-event {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.week-event.work {
  background: rgba(78, 154, 255, 0.2);
  border-left: 2px solid #4e9aff;
  color: #90baff;
}

.week-event.private {
  background: rgba(78, 204, 163, 0.2);
  border-left: 2px solid var(--plus);
  color: var(--plus);
}

.week-event.all-day {
  background: rgba(245, 166, 35, 0.2);
  border-left: 2px solid var(--warning);
  color: var(--warning);
}

/* =============================================
   サブタブ（経費）
   ============================================= */

.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.sub-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--subtext);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.sub-tab-btn:hover {
  color: var(--text);
}

.sub-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--highlight);
}

.sub-tab-panel {
  display: none;
}

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

/* =============================================
   設定タブ
   ============================================= */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.settings-item-info .name {
  font-size: 13px;
  font-weight: 600;
}

.settings-item-info .sub {
  font-size: 12px;
  color: var(--subtext);
}

.settings-item-actions {
  display: flex;
  gap: 6px;
}

.budget-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.budget-form-item {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px;
}

.budget-form-item .category-name {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 6px;
}

.export-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =============================================
   チャートコンテナ
   ============================================= */

.chart-container {
  position: relative;
  height: 280px;
}

.chart-container.small {
  height: 200px;
}

/* =============================================
   モーダル
   ============================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--subtext);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--highlight);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* =============================================
   トースト通知
   ============================================= */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  z-index: 2000;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 3px solid var(--plus);
}

.toast.error {
  border-left: 3px solid var(--minus);
}

.toast.info {
  border-left: 3px solid #4e9aff;
}

/* =============================================
   テキストカラーユーティリティ
   ============================================= */

.text-positive { color: var(--plus); }
.text-negative { color: var(--minus); }
.text-warning { color: var(--warning); }
.text-subtext { color: var(--subtext); }
.text-bold { font-weight: 700; }
.text-right { text-align: right; }

/* =============================================
   バッジ
   ============================================= */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-paid {
  background: rgba(78, 204, 163, 0.2);
  color: var(--plus);
  border: 1px solid rgba(78, 204, 163, 0.3);
}

.badge-unpaid {
  background: rgba(233, 69, 96, 0.2);
  color: var(--minus);
  border: 1px solid rgba(233, 69, 96, 0.3);
}

.badge-recurring {
  background: rgba(78, 154, 255, 0.2);
  color: #4e9aff;
  border: 1px solid rgba(78, 154, 255, 0.3);
}

/* =============================================
   アップロードエリア
   ============================================= */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.upload-area:hover,
.upload-area.dragging {
  border-color: var(--highlight);
  background: rgba(233,69,96,0.05);
}

.upload-area-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.upload-area-text {
  font-size: 13px;
  color: var(--subtext);
}

.upload-area-hint {
  font-size: 11px;
  color: var(--subtext);
  margin-top: 4px;
}

/* =============================================
   ローディング
   ============================================= */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--highlight);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--subtext);
  gap: 12px;
}

/* =============================================
   納税準備金グリッド
   ============================================= */

.tax-reserve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.tax-reserve-item {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.tax-reserve-company {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 8px;
}

.tax-reserve-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--warning);
}

/* =============================================
   セル内ドロップダウン
   ============================================= */

.inline-select {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  max-width: 120px;
}

.inline-input {
  background: var(--accent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  width: 100%;
  max-width: 150px;
}

/* =============================================
   スクロールバー
   ============================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* =============================================
   レスポンシブ（スマホ）
   ============================================= */

@media (max-width: 600px) {
  .header-title {
    display: none;
  }

  .main-content {
    padding: 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .weekly-calendar {
    grid-template-columns: 1fr;
  }
}
