/* ============================================================
   assets/css/style.css  ―  共通スタイル
   ============================================================ */
:root {
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --green:     #16a34a;
  --danger:    #dc2626;
  --warn:      #f59e0b;
  --bg:        #f8fafc;
  --bg-card:   #ffffff;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-secondary: #64748b;
  --text-tertiary:  #94a3b8;
  --radius:    10px;
  --shadow:    0 1px 4px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* ===== ログインページ ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-wrap { width: 100%; max-width: 380px; }
.login-card { background: var(--bg-card); border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.1); padding: 32px 28px; }
.login-logo { width: 56px; height: 56px; background: var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.login-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 20px; }
.login-note  { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 14px; }

/* ===== フォーム共通 ===== */
.form-group { margin-bottom: 14px; }
.form-group label, .form-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
.form-label-hint { font-size: 10px; color: var(--text-tertiary); font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); background: var(--bg-card); outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--primary); }

/* ===== ボタン ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: opacity .15s, background .15s; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-primary-green, .btn-confirm.btn-primary-green { background: var(--green); color: #fff; }
.btn-ghost  { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
.btn-danger { background: none; color: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warn); color: #fff; }
.btn-add    { width: 100%; padding: 10px; background: var(--bg-card); color: var(--primary); border: 1.5px dashed #93c5fd; border-radius: 11px; font-size: 13px; font-weight: 500; }
.btn-add:hover:not(:disabled) { background: #eff6ff; }
.btn-block  { width: 100%; }
.btn-sm     { padding: 5px 11px; font-size: 12px; }
.btn-confirm { width: 100%; padding: 12px; font-size: 14px; font-weight: 500; margin-bottom: 8px; }

/* ===== アラート ===== */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-info  { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.alert-warn  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ===== アプリヘッダー ===== */
.app-header { background: var(--primary); color: #fff; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; flex-direction: column; }
.header-title { font-size: 14px; font-weight: 600; }
.header-user  { font-size: 11px; opacity: .8; }
.header-right { display: flex; align-items: center; gap: 4px; }
.hdr-btn { background: rgba(255,255,255,.18); border: none; border-radius: 7px; color: #fff; cursor: pointer; padding: 5px 8px; font-size: 11px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.hdr-btn:hover { background: rgba(255,255,255,.28); }
.hdr-btn-logout { text-decoration: none; }

/* ===== メインコンテンツ ===== */
.reserve-main { padding: 14px; max-width: 600px; margin: 0 auto; }

/* ===== カウンターバー ===== */
.count-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.count-bar-label { font-size: 12px; color: var(--text-secondary); }
.count-bar-hint  { font-size: 11px; color: var(--text-tertiary); }
.count-bar-num   { font-size: 22px; font-weight: 700; color: var(--primary); }
.count-bar-max   { font-size: 13px; color: var(--text-secondary); }

/* ===== 店舗 ===== */
.store-label-fixed { background: #eff6ff; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #1e40af; font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 5px; }
.store-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.store-tab  { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; background: var(--bg-card); color: var(--text-secondary); }
.store-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dedicated-notice { background: #eff6ff; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: #1e40af; margin-bottom: 12px; display: flex; align-items: center; gap: 5px; }

/* ===== カレンダー ===== */
.legend-row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.leg { font-size: 12px; color: var(--text-secondary); }
.leg.ok  { color: #16a34a; }
.leg.tri { color: #d97706; }
.leg.ng  { color: var(--danger); }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-secondary); padding: 2px 8px; }
.cal-month-label { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 14px; }
.cal-dow  { text-align: center; font-size: 11px; color: var(--text-secondary); padding: 4px 0; font-weight: 500; }
.cal-cell { text-align: center; border-radius: 8px; cursor: pointer; padding: 4px 2px; }
.cal-cell.other  { opacity: .3; cursor: default; }
.cal-cell.past   { opacity: .35; cursor: default; }
.cal-cell.ng-day { cursor: default; }
.cal-cell.today .cal-day-num  { color: var(--primary); font-weight: 700; }
.cal-cell.sel .cal-day-num { background: var(--primary); color: #fff; border-radius: 6px; display: inline-block; width: 26px; line-height: 26px; }
.cal-cell:not(.past):not(.other):not(.sel):not(.ng-day):hover .cal-day-num { background: var(--bg); border-radius: 6px; }
.cal-day-num { font-size: 13px; color: var(--text); line-height: 1.3; }
.avail-mark    { font-size: 11px; margin-top: 1px; }
.avail-mark.ok  { color: #16a34a; }
.avail-mark.tri { color: #d97706; }
.avail-mark.ng  { color: var(--danger); }

/* ===== 時間スロット ===== */
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.time-col-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.time-slots { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.ts-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.ts-row:hover:not(.ng-row) { background: var(--bg); }
.ts-row.sel     { background: #eff6ff; border: 1px solid #93c5fd; }
.ts-row.ng-row  { opacity: .4; cursor: default; }
.ts-time  { font-size: 12px; font-variant-numeric: tabular-nums; width: 90px; flex-shrink: 0; }
.ts-mark  { font-size: 12px; width: 18px; text-align: center; }
.ts-mark.ok  { color: #16a34a; }
.ts-mark.tri { color: #d97706; }
.ts-mark.ng  { color: var(--danger); }
.ts-label { font-size: 11px; color: var(--text-secondary); }
.ts-empty { padding: 10px; font-size: 12px; color: var(--text-tertiary); }
.sel-hint    { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; min-height: 18px; }
.sel-hint-ok { color: var(--primary); font-weight: 500; }

/* ===== カート ===== */
.cart-section   { margin-bottom: 12px; }
.cart-header    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.cart-header-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.cart-badge-cnt { background: var(--primary); color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.cart-item { border: 1px solid #93c5fd; border-radius: 8px; padding: 9px 12px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; background: #f0f7ff; }
.ci-store  { font-size: 11px; color: var(--primary); font-weight: 500; margin-bottom: 2px; }
.ci-detail { font-size: 13px; color: var(--text); font-weight: 500; }
.ci-del    { background: none; border: none; cursor: pointer; color: var(--text-tertiary); font-size: 18px; padding: 2px 6px; }

/* ===== ポップトースト ===== */
.pop-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1e40af; color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.6; box-shadow: 0 4px 20px rgba(0,0,0,.2); display: none; z-index: 100; width: calc(100% - 32px); max-width: 400px; }
.pt-title  { font-weight: 600; margin-bottom: 4px; }
.pt-body   { font-size: 12px; opacity: .9; }
.pop-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: #fff; cursor: pointer; font-size: 16px; opacity: .7; }

/* ===== ドロワー ===== */
.drawer-bg  { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.drawer-bg.open { display: flex; animation: fadein .2s; }
.drawer     { background: var(--bg-card); border-radius: 20px 20px 0 0; width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto; padding-bottom: 24px; }
.drawer-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto 0; }
.drawer-title-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.drawer-title-text { font-size: 15px; font-weight: 600; color: var(--text); }
.drawer-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-secondary); }
.drawer-body { padding: 14px 16px; }

/* ===== 設定ドロワー ===== */
.save-toast { background: var(--green); color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; text-align: center; margin-bottom: 12px; display: none; }
.setting-section-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
.setting-section { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row.clickable { cursor: pointer; }
.setting-row.clickable:hover { background: var(--bg); }
.setting-label { font-size: 13px; color: var(--text); }
.setting-sub   { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.setting-value-wrap { display: flex; align-items: center; gap: 4px; }
.setting-value { font-size: 12px; color: var(--text-secondary); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.setting-arrow { color: var(--text-tertiary); font-size: 16px; }
.mono { font-variant-numeric: tabular-nums; font-family: 'Courier New', monospace; }
.toggle { width: 42px; height: 24px; background: var(--border); border-radius: 12px; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle.on   { background: var(--primary); }
.toggle-knob { width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on .toggle-knob { left: 21px; }
.edit-form   { background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 14px; display: none; }
.edit-form.open { display: block; }
.ef-label    { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.ef-input    { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; background: var(--bg-card); margin-bottom: 8px; }
.ef-btns     { display: flex; gap: 7px; }

/* ===== 予約一覧ドロワー ===== */
.res-group-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin: 10px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.res-card   { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.rc-top     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.rc-store   { font-size: 11px; font-weight: 600; color: var(--primary); background: #eff6ff; padding: 2px 9px; border-radius: 10px; }
.rc-no      { font-size: 11px; color: var(--text-tertiary); font-family: monospace; }
.rc-date    { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.rc-time, .rc-room { font-size: 13px; color: var(--text-secondary); margin-bottom: 2px; }
.rc-lock    { font-size: 11px; color: var(--text-tertiary); margin-top: 5px; }
.empty-state { text-align: center; padding: 32px 0; color: var(--text-tertiary); font-size: 13px; }
.empty-icon  { font-size: 36px; margin-bottom: 10px; }

/* ===== モーダル ===== */
.modal-bg   { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; animation: fadein .2s; }
.modal      { background: var(--bg-card); border-radius: 14px; padding: 22px; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.modal-sub   { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.modal-btns  { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.mail-note   { background: #eff6ff; border-radius: 8px; padding: 9px 12px; font-size: 12px; color: #1e40af; margin-bottom: 12px; }
.confirm-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 7px; }
.ci-num  { font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 3px; }
.ci-info { font-size: 13px; font-weight: 600; color: var(--text); }
.ci-sub  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.done-icon-wrap { text-align: center; margin-bottom: 12px; }
.sum-card   { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.sum-row    { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.sum-row:last-child { border-bottom: none; }
.sum-row .sl { color: var(--text-secondary); }

@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
