/* ==========================================================================
   業務日報・給料集計システム - モバイル最適化 スタイルシート (style.css)
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --salon-gold: #c59b27;
  --salon-rose: #be185d;
  --salon-rose-light: #fdf2f8;
  
  --success: #15803d;
  --success-light: #f0fdf4;
  --warning: #b45309;
  --warning-light: #fffbeb;
  --danger: #b91c1c;
  --danger-light: #fef2f2;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* リセット */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 90px; /* ボトムナビ用の余白 */
}

body.modal-open {
  overflow: hidden;
}

/* アプリケーション全体コンテナ */
.app-container {
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: #ffffff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.04);
}

/* ヘッダー */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-text .sub-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}

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

.btn-header {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.btn-header:active {
  background: #e2e8f0;
}

/* メインコンテンツ領域 */
.app-content {
  flex: 1;
  padding: 16px;
}

/* タブ画面切り替え */
.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease;
}

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

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

/* 共通カード */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

/* ★ iOS自動ズーム防止: 入力要素 font-size >= 16px, height >= 48px ★ */
.form-group {
  margin-bottom: 20px; /* 誤タップ防止 16px以上 */
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.form-label .badge-req {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 4px;
}

.form-label .badge-opt {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* インプット・セレクトの基本仕様 */
.form-input,
.form-select {
  width: 100%;
  height: 48px; /* HIG 44px以上を上回る48px */
  font-size: 16px; /* iOS Safari 自動ズーム防止 */
  font-family: inherit;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: #fafbfc;
  color: var(--text-main);
  transition: all 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 36px;
}

/* 金額入力プレフィックス/サフィックス */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-prefix {
  padding-left: 32px !important;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.input-suffix {
  position: absolute;
  right: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* クイック入力補助ボタン群 */
.quick-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-chip:active {
  background: #e2e8f0;
  transform: scale(0.97);
}

.btn-chip.selected {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

/* 複数売上動的入力スタイル */
.multi-sales-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 14px 12px 14px;
}
.multi-sales-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.auto-sum-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 3px 10px;
  border-radius: 20px;
}
.auto-sum-label {
  font-size: 11px;
  color: #3b82f6;
  font-weight: 700;
}
.auto-sum-val {
  font-size: 15px;
  font-weight: 800;
}
.multi-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.multi-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.15s ease-out;
}
.item-input-group {
  flex: 1;
}
.btn-item-del {
  width: 44px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #ef4444;
  font-size: 16px;
  font-weight: bold;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-item-del:active {
  background: #fca5a5;
  color: #b91c1c;
  transform: scale(0.95);
}
.multi-sales-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.btn-add-item-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px dashed #93c5fd;
  color: #2563eb;
  padding: 8px 14px;
  min-height: 42px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}
.btn-add-item-row:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}
.btn-add-item-row:active {
  background: #dbeafe;
  transform: scale(0.98);
}

/* 日付選択まわり */
.date-selector-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-badge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.day-badge-bar.badge-weekday {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.day-badge-bar.badge-saturday {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.day-badge-bar.badge-holiday {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.day-badge-bar.badge-sunday {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* 勤務時間 2連プルダウン */
.time-select-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 指名数ステッパー */
.stepper-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-stepper {
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 20px;
  font-weight: bold;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-stepper:active {
  background: #e2e8f0;
  transform: scale(0.95);
}

.stepper-input {
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  font-family: var(--font-mono);
}

/* 見積もりバッジカード */
.estimate-preview-card {
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.estimate-preview-info {
  display: flex;
  flex-direction: column;
}

.estimate-preview-label {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
}

.estimate-preview-detail {
  font-size: 11px;
  color: var(--text-muted);
}

.estimate-preview-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #1d4ed8;
}

/* 主ボタン（高さ 50px〜52px） */
.btn-primary {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  width: 100%;
  height: 50px;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-secondary:active {
  background: #e2e8f0;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-success:active {
  background: #15803d;
}

/* 直近の入力一覧カード */
.recent-records-section {
  margin-top: 24px;
}

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

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.record-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.record-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.record-staff-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.record-hours-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #475569;
}

.record-sales-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.record-item-action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.btn-icon:active {
  background: #e2e8f0;
}

/* ==========================================================================
   月次締め画面・スタッフカードリスト
   ========================================================================== */
.monthly-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.staff-monthly-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.staff-monthly-card:hover {
  border-color: #94a3b8;
}

.staff-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.staff-name-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.staff-wage-tags {
  font-size: 11px;
  color: var(--text-muted);
}

.monthly-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.m-stat-box .m-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

.m-stat-box .m-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.monthly-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.monthly-input-item {
  display: flex;
  flex-direction: column;
}

.monthly-input-item label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.monthly-input-item input {
  height: 44px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-family: var(--font-mono);
}

.monthly-salary-preview-bar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.msp-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
  white-space: nowrap;
}

.msp-sub {
  font-size: 10px;
  font-weight: normal;
  color: #2563eb;
  white-space: nowrap;
}

.msp-val {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #1d4ed8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 過去帳票ライブラリ */
.reports-library-box {
  margin-top: 24px;
  border-top: 2px solid #e2e8f0;
  padding-top: 18px;
}

.library-year-group {
  margin-bottom: 16px;
}

.library-year-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.library-months-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-report-month {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-report-month:active {
  background: #eff6ff;
  border-color: var(--primary);
  transform: scale(0.97);
}

/* ==========================================================================
   スタッフマスタ画面
   ========================================================================== */
.staff-master-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sm-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sm-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-name {
  font-size: 16px;
  font-weight: 700;
}

.badge-active {
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-inactive {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}

.sm-details {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   ボトム固定ナビゲーションバー（スマホ用）
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 10px 0;
  max-width: 580px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  gap: 3px;
  transition: color 0.12s ease;
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.nav-item:active {
  transform: scale(0.95);
}

/* ==========================================================================
   確認モーダル（画面中央オーバーレイ ＆ スクロールロック）
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-float);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px; /* 誤タップ防止のためボタン間隔を十分に配置 */
}

/* モーダル内サマリー表 */
.confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.confirm-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.confirm-table th {
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 4px;
  font-weight: 600;
  width: 35%;
}

.confirm-table td {
  text-align: right;
  font-size: 15px;
  color: var(--text-main);
  padding: 8px 4px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* トースト通知 */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

.toast.toast-success {
  background: #065f46;
}

.toast.toast-error {
  background: #991b1b;
}

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

/* ==========================================================================
   モバイル・エンドポイント端末向けレスポンシブ最適化
   1行表示の徹底（折り返し防止・文字サイズおよびパディング適正化）
   ========================================================================== */
@media (max-width: 480px) {
  .app-header {
    padding: 8px 10px;
    gap: 6px;
  }
  .brand-area {
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .brand-text {
    min-width: 0;
  }
  .brand-text h1 {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }
  .brand-text .sub-tag {
    font-size: 9px;
    padding: 0 4px;
    white-space: nowrap;
  }
  .header-actions {
    gap: 5px;
    flex-shrink: 0;
  }
  .btn-header {
    padding: 5px 8px;
    font-size: 11px;
    gap: 3px;
    white-space: nowrap;
  }
  .card {
    padding: 14px 12px;
    margin-bottom: 16px;
  }
  .card-title {
    font-size: 15.5px;
    white-space: nowrap;
  }
  .btn-chip {
    padding: 0 8px;
    font-size: 11.5px;
    white-space: nowrap;
    min-height: 32px;
  }
  .quick-buttons {
    gap: 5px;
  }
  .day-badge-bar {
    font-size: 11.5px;
    padding: 5px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .estimate-preview-card {
    padding: 10px 12px;
  }
  .estimate-preview-label {
    font-size: 11.5px;
    white-space: nowrap;
  }
  .estimate-preview-detail {
    font-size: 10px;
    white-space: nowrap;
  }
  .estimate-preview-val {
    font-size: 16px;
    white-space: nowrap;
  }
  .btn-primary, .btn-secondary {
    font-size: 13.5px;
    padding: 12px 10px;
  }
  .btn-primary span, .btn-secondary span {
    white-space: nowrap;
  }
  .staff-card-header {
    flex-wrap: wrap;
    gap: 4px;
  }
  .staff-name-title {
    font-size: 14px;
    white-space: nowrap;
  }
  .staff-wage-tags {
    font-size: 10.5px;
    white-space: nowrap;
  }
  .monthly-stats-grid {
    gap: 4px;
    padding: 6px 4px;
  }
  .m-stat-box {
    padding: 4px 2px;
  }
  .m-lbl {
    font-size: 9px;
    white-space: nowrap;
  }
  .m-val {
    font-size: 11.5px;
    white-space: nowrap;
  }
  .msp-sub {
    display: none; /* スマホでは内訳補足を隠して概算総額一行表示を最優先 */
  }
  .msp-label {
    font-size: 11.5px;
  }
  .msp-val {
    font-size: 15px;
  }
  .bottom-nav {
    padding: 4px 0 8px 0;
  }
  .nav-item {
    font-size: 10px;
    padding: 2px 0;
    white-space: nowrap;
  }
  .nav-icon {
    font-size: 18px;
  }
  .confirm-table th, .confirm-table td {
    padding: 6px 2px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .brand-text .sub-tag {
    display: none; /* 380px以下の極小画面ではサブタイトルを隠し、ヘッダーボタン一行表示を徹底 */
  }
  .app-header {
    padding: 6px 8px;
    gap: 4px;
  }
  .btn-header {
    padding: 4px 6px;
    font-size: 10px;
    gap: 2px;
  }
  .btn-header span:first-child {
    font-size: 11px;
  }
}
