/* ============================================================
   style.css — 売上管理システム 共通スタイル
   ============================================================ */

/* --- CSS変数 --- */
:root {
  --color-bg:           #f0efe9;
  --color-bg-card:      #ffffff;
  --color-bg-secondary: #fafaf8;
  --color-text:         #1a1a18;
  --color-text-secondary: #6b6b67;
  --color-text-muted:   #9a9994;
  --color-border:       rgba(0,0,0,0.1);
  --color-coral:        #D85A30;
  --color-teal:         #1D9E75;
  --color-blue:         #378ADD;
  --color-amber:        #E65100;
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
}

/* --- リセット --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}
textarea { resize: vertical; }

/* --- ナビバー --- */
.navbar {
  background: #1a1a18;
  color: #fff;
  padding: 0 1.75rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { font-size: 18px; font-weight: 500; }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 15px;
  color: #9a9994;
}
.navbar-right a { color: #9a9994; text-decoration: none; border: 0.5px solid rgba(255,255,255,0.3); border-radius: 8px; padding: 6px 14px; transition: all .15s; }
.navbar-right a:hover { color: #fff; border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.08); }
.shop-name {
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #f0efe9;
}

/* --- コンテナ --- */
.container {
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* --- サブナビ --- */
.subnav {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.subnav a {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  text-decoration: none;
  color: var(--color-text-secondary);
  border: 0.5px solid var(--color-border);
  background: var(--color-bg-card);
  display: flex;
  align-items: center;
  gap: 4px;
}
.subnav a:hover { background: var(--color-bg); }
.subnav a.active { background: #1a1a18; color: #fff; border-color: #1a1a18; }

/* --- 上段メインナビ（画面間移動・小さめ） --- */
.mainnav { display: flex; gap: 4px; margin-bottom: 1.25rem; flex-wrap: wrap; }
.mainnav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-decoration: none;
  color: var(--color-text-secondary);
  border: 0.5px solid var(--color-border);
  background: var(--color-bg-card);
  display: inline-flex; align-items: center; gap: 6px;
}
.mainnav a:hover { background: var(--color-bg); }
.mainnav a.active { background: #1a1a18; color: #fff; border-color: #1a1a18; }

/* --- カード --- */
.card {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* --- ボタン --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn:hover { opacity: .8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: #1a1a18; color: #fff; border-color: #1a1a18; }
.btn-teal    { background: var(--color-teal); color: #fff; border-color: var(--color-teal); }
.btn-blue    { background: var(--color-blue); color: #fff; border-color: var(--color-blue); }
.btn-danger  { background: #D85A30; color: #fff; border-color: #D85A30; }
.btn-ghost   { background: transparent; border: none; color: var(--color-text-secondary); }
.btn-block   { width: 100%; justify-content: center; }
.btn-sm      { padding: 4px 10px; font-size: 12px; }

/* --- フォームフィールド --- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--color-text-secondary); }
.field input, .field select, .field textarea {
  height: 38px;
  padding: 0 10px;
  border: 0.5px solid rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  width: 100%;
}
.field textarea { height: auto; padding: 8px 10px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(55,138,221,0.1);
}

/* --- グリッド --- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }

/* --- バッジ --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-teal   { background: #E1F5EE; color: #085041; }
.badge-blue   { background: #E6F1FB; color: #0C447C; }
.badge-amber  { background: #FFF3E0; color: #E65100; }
.badge-coral  { background: #FAECE7; color: #993C1D; }
.badge-gray   { background: #f0efe9; color: #6b6b67; }
.badge-danger { background: #FAECE7; color: #C62828; }

/* --- アラート --- */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-ok  { background: #E1F5EE; color: #085041; border: 0.5px solid #1D9E75; }
.alert-err { background: #FAECE7; color: #993C1D; border: 0.5px solid #D85A30; border-left: 3px solid #D85A30; }

/* --- テーブル --- */
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 7px 10px;
  border-bottom: 0.5px solid var(--color-border);
  background: var(--color-bg-secondary);
  white-space: nowrap;
}
td {
  padding: 9px 10px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  color: var(--color-text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,0,0,0.015); }

/* --- 予約カード --- */
.res-card {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
}
.res-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  flex-wrap: wrap;
}
.res-head:hover { background: rgba(0,0,0,0.02); }
.res-body { padding: 12px 14px; border-top: 0.5px solid var(--color-border); background: var(--color-bg-secondary); }
.no-badge {
  font-size: 11px;
  font-family: monospace;
  padding: 2px 7px;
  background: #f0efe9;
  border-radius: 4px;
  color: var(--color-text-secondary);
}

/* --- 詳細行 --- */
.prow { display: flex; align-items: center; padding: 5px 0; border-bottom: 0.5px solid rgba(0,0,0,0.05); font-size: 13px; }
.prow:last-child { border-bottom: none; }
.plabel { font-size: 11px; color: var(--color-text-secondary); min-width: 80px; }
.pval   { font-weight: 500; }
.ptotal { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; font-weight:500; border-top:0.5px solid var(--color-border); margin-top:4px; }
.pprofit{ display:flex; justify-content:space-between; padding:4px 0; font-size:12px; color:#085041; }
.pexp   { display:flex; justify-content:space-between; padding:4px 0; font-size:12px; color:#993C1D; }

/* --- フィルターバー --- */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
}
.filter-bar input, .filter-bar select { height: 34px; padding: 0 10px; border: 0.5px solid rgba(0,0,0,0.2); border-radius: var(--radius-sm); font-size: 13px; background: #fff; }

/* --- モーダル --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-title { font-size: 16px; font-weight: 500; margin-bottom: 1rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--color-border);
}

/* --- 空状態 --- */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-secondary);
  font-size: 13px;
}
.empty-icon { display: block; font-size: 2rem; margin-bottom: 10px; }

/* --- レスポンシブ --- */
@media (max-width: 640px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .navbar-right .shop-name { display: none; }
  .container { padding: 1rem .75rem; }
  .res-head { gap: 6px; }
}
@media (max-width: 400px) {
  .subnav a span { display: none; }
}
