.demo-restaurant {
  --navy: #1B3A4B;
  --terra: #C1622E;
  --terra-deep: #9C4C22;
  --white: #FAFAF7;
  --paper: #F2F0E8;
  --ink: #233138;
  --ink-soft: #5C6B70;
  --line: #DCD8CC;
  --ok: #3C8C5C;
  --wait: #C9A227;
  --loss: #C44545;
  background: var(--paper);
}
.demo-restaurant * { box-sizing: border-box; }
.demo-restaurant main { max-width: 1040px; margin: 0 auto; padding: 32px 20px 80px; }
.demo-restaurant h1 { font-size: 22px; margin: 0 0 4px; }
.demo-restaurant .subhead { color: var(--ink-soft); font-size: 13px; margin-bottom: 24px; }
.demo-restaurant .sales-data-note {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.8;
  margin: -12px 0 24px;
  padding: 12px 14px;
  background: #FBF4EE;
  border: 1px solid #EDD9CC;
  border-radius: 4px;
}

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.tab-btn {
  background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px 22px; color: var(--ink-soft); cursor: pointer;
  border-bottom: 3px solid transparent; transform: translateY(2px); transition: color 0.15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--terra-deep); border-bottom-color: var(--terra); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: #FBFAF6;
  flex-wrap: wrap; gap: 8px;
}
.sec-head h2 { font-size: 15px; margin: 0; }
.sec-head .date { font-size: 12px; color: var(--ink-soft); }
.sec-head .add-btn {
  background: var(--terra); color: var(--white); border: none; padding: 7px 16px;
  border-radius: 4px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease;
}
.sec-head .add-btn:hover { background: var(--terra-deep); }

.hint { padding: 10px 20px; font-size: 12px; color: var(--ink-soft); background: #FBFAF6; border-top: 1px solid var(--line); }
.empty-state { padding: 32px 20px; text-align: center; color: var(--ink-soft); font-size: 13px; }

.legend { display: flex; gap: 16px; padding: 14px 20px 0; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot.empty { background: #fff; border: 1px solid var(--line); }
.dot.using { background: #FBE3D3; }
.dot.reserved { background: #FAF1D6; }
.dot.done { background: #DEEFE2; }

.floor-scroll {
  margin: 16px 20px 8px;
}
.floor-wrap {
  position: relative;
  width: 100%;
  height: 480px;
  background:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  overflow: hidden;
}
@media (max-width: 700px) {
  .floor-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .floor-wrap {
    width: 640px;
    min-width: 640px;
    height: 580px;
  }
}
.floor-section-label {
  position: absolute;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.table-item {
  position: absolute;
  border-radius: 6px;
  border: 2px solid transparent;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-size: 11.5px;
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}
.table-item:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(27,58,75,0.16); }
.table-item .t-name { font-weight: 700; font-size: 12.5px; }
.table-item .t-seats { font-size: 10.5px; color: var(--ink-soft); }
.table-item .t-guest { font-size: 10.5px; margin-top: 2px; font-weight: 600; }
.table-item.empty { border-color: var(--line); }
.table-item.using { background: #FBE3D3; border-color: #EDB28D; }
.table-item.reserved { background: #FAF1D6; border-color: #E6CD7E; }
.table-item.done { background: #DEEFE2; border-color: #A9D2B5; }

/* カウンター席: 1人用の小さな区画 */
.table-item.counter { border-radius: 4px; padding: 2px; gap: 0; }
.table-item.counter .t-name { font-size: 11px; }
.table-item.counter .t-seats { display: none; }
.table-item.counter .t-guest { font-size: 8.5px; line-height: 1.15; margin-top: 1px; }

table.stock { width: 100%; border-collapse: collapse; font-size: 13px; }
table.stock th, table.stock td { padding: 11px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.stock th { background: #F4F2EA; font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
table.stock tr:last-child td { border-bottom: none; }
table.stock tr.new-row-stock { animation: flashIn 1.2s ease; }
@keyframes flashIn { 0% { background: #FBE3D3; } 100% { background: transparent; } }
.stock-bar-wrap { display: flex; align-items: center; gap: 8px; }
.stock-bar-track { flex: 1; height: 8px; background: #EFEDE3; border-radius: 4px; overflow: hidden; min-width: 60px; }
.stock-bar-fill { height: 100%; border-radius: 4px; }
.stock-bar-fill.ok { background: var(--ok); }
.stock-bar-fill.low { background: var(--loss); }
.stock-qty { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.low-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--loss);
  background: #FBEAEA; padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
button.btn-order {
  background: var(--terra); color: var(--white); border: none; padding: 6px 14px;
  border-radius: 4px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease;
}
button.btn-order:hover { background: var(--terra-deep); }
button.btn-order:disabled { background: #E3B79C; cursor: default; }

.order-history { list-style: none; margin: 0; padding: 0; }
.order-row {
  display: grid; grid-template-columns: 90px 1fr 90px; gap: 10px; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.order-row:last-child { border-bottom: none; }
.order-row.new-row { animation: flashIn 1.2s ease; }
.order-row .o-date { color: var(--ink-soft); font-size: 12px; }
.order-row .o-status {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; text-align: center; white-space: nowrap;
  background: #FAF1D6; color: #8A6D14;
}

.profit-bar {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; margin-bottom: 28px;
}
.profit-cell { background: var(--white); padding: 18px 20px; text-align: center; }
.profit-cell .label { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.profit-cell .value { font-size: 20px; font-weight: 700; color: var(--ink); }
.profit-cell.total { background: #FBF4EE; }
.profit-cell.total .value { color: var(--terra-deep); }
@media (max-width: 600px) { .profit-bar { grid-template-columns: 1fr; } }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 20px 20px; }
@media (max-width: 760px) { .menu-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .menu-grid { grid-template-columns: 1fr; } }
.menu-card {
  border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.menu-card .m-name { font-weight: 700; font-size: 14px; }
.menu-card .m-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.menu-card .m-row .m-val { font-weight: 700; color: var(--ink); }
.menu-card .m-ratio {
  margin-top: 4px; font-size: 12.5px; font-weight: 700; text-align: center;
  padding: 5px 0; border-radius: 4px;
}
.menu-card .m-ratio.good { background: #E3F0E8; color: var(--ok); }
.menu-card .m-ratio.warn { background: #FDEEDD; color: var(--terra-deep); }
.menu-card .m-ratio.bad { background: #FBEAEA; color: var(--loss); }

.ranking-list { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.rank-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 16px;
}
.rank-row:nth-child(1) { border-color: #E6CD7E; background: #FDFAF0; }
.rank-row:nth-child(2) { border-color: #D8D8D8; background: #FBFBFA; }
.rank-row:nth-child(3) { border-color: #E6C7A8; background: #FDF8F3; }
.rank-no {
  font-size: 14px; font-weight: 700; color: var(--ink-soft); text-align: center;
}
.rank-row:nth-child(1) .rank-no { color: #B8901E; }
.rank-row:nth-child(2) .rank-no { color: #8A8A8A; }
.rank-row:nth-child(3) .rank-no { color: var(--terra-deep); }
.rank-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rank-count { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.rank-unit { font-size: 11px; font-weight: 400; color: var(--ink-soft); margin-left: 2px; }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(27, 58, 75, 0.45);
  align-items: center; justify-content: center; padding: 20px; z-index: 200; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 6px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25); overflow: hidden; margin: auto;
}
.modal-head {
  background: var(--navy); color: var(--white); padding: 16px 20px; font-size: 14.5px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head .slot-info { font-size: 12px; color: #CFE0E6; font-weight: 400; margin-top: 4px; }
.modal-close { background: none; border: none; color: var(--white); font-size: 18px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.field select, .field input {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 13.5px; background: var(--white); color: var(--ink); font-family: inherit;
}
.field select:focus, .field input:focus { outline: 2px solid var(--terra); outline-offset: 1px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; flex-wrap: wrap; }
button.btn-cancel {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 9px 18px; border-radius: 4px; font-size: 13px; cursor: pointer; font-family: inherit;
}
button.btn-submit {
  background: var(--terra); color: var(--white); border: none; padding: 9px 20px;
  border-radius: 4px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease;
}
button.btn-submit:hover { background: var(--terra-deep); }
button.btn-submit:disabled { background: #E3B79C; cursor: default; }
button.btn-delete {
  background: none; border: 1px solid var(--loss); color: var(--loss);
  padding: 9px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease;
}
button.btn-delete:hover { background: #FBEAEA; }

.detail-modal-body { display: flex; flex-direction: column; gap: 0; padding: 4px 20px 8px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.detail-row:last-child { border-bottom: none; }
.d-label { color: var(--ink-soft); font-size: 12.5px; }
.d-value { font-weight: 700; color: var(--ink); text-align: right; }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--white); padding: 12px 22px; border-radius: 6px;
  font-size: 13px; opacity: 0; transition: all 0.25s ease; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
</style>
