/* ========= 基本設定 ========= */
:root {
    --bg: #0f1115;
    --card: #161a21;
    --elev: #1c222b;
    --text: #e8eef7;
    --subtext: #a8b2c3;
    --muted: #6b7280;
    --brand: #4f8cff;          /* アクション色 */
    --brand-press: #3a72db;
    --ok: #22c55e;
    --warn: #f59e0b;
    --err: #ef4444;
    --ring: rgba(79, 140, 255, .45);
    --radius: 14px;
    --shadow: 0 8px 24px rgba(0,0,0,.25);
    --gap: 14px;
    --pad: 16px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  }
  
  @media (prefers-color-scheme: light) {
    :root {
      --bg: #f7f8fb;
      --card: #ffffff;
      --elev: #f3f4f6;
      --text: #111827;
      --subtext: #4b5563;
      --muted: #9ca3af;
      --ring: rgba(79, 140, 255, .35);
      --shadow: 0 10px 24px rgba(17,24,39,.08);
    }
  }
  
  html, body {
    height: 100%;
    -webkit-text-size-adjust: 100%;
  }
  
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
  }
  
  /* iOS セーフエリア考慮 */
  .m-reserve {
    padding:
      calc(var(--pad) + env(safe-area-inset-top))
      var(--pad)
      calc(96px + env(safe-area-inset-bottom));
    max-width: 720px;
    margin: 0 auto;
  }
  
  /* ========= ヘッダ / 見出し ========= */
  .m-reserve h1 {
    font-size: 1.3rem;
    margin: 0 0 10px;
    letter-spacing: .02em;
  }
  
  .m-reserve .subtitle {
    color: var(--subtext);
    font-size: .9rem;
    margin-bottom: 18px;
  }
  
  /* ========= カード ========= */
  .m-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: var(--gap);
    border: 1px solid rgba(255,255,255,.04);
  }
  
  /* ========= ラベル & フィールド ========= */
  .m-field {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .m-label {
    font-size: .92rem;
    color: var(--subtext);
  }
  
  .m-required::after {
    content: " *";
    color: var(--warn);
  }
  
  .m-input,
  .m-select,
  .m-textarea {
    width: 100%;
    font-size: 16px; /* iOS ズーム抑止 */
    color: var(--text);
    background: var(--elev);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
  }
  
  .m-input::placeholder,
  .m-textarea::placeholder {
    color: var(--muted);
  }
  
  .m-textarea {
    min-height: 96px;
    resize: vertical;
  }
  
  .m-select {
    background-image:
      linear-gradient(45deg, transparent 50%, var(--muted) 50%),
      linear-gradient(135deg, var(--muted) 50%, transparent 50%),
      linear-gradient(to right, transparent, transparent);
    background-position:
      calc(100% - 20px) calc(50% - 4px),
      calc(100% - 14px) calc(50% - 4px),
      calc(100% - 40px) 0.5em;
    background-size: 6px 6px, 6px 6px, 1px 1.5em;
    background-repeat: no-repeat;
    padding-right: 40px;
  }
  
  /* フォーカスリング */
  .m-input:focus,
  .m-select:focus,
  .m-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring);
  }
  
  /* 無効状態 */
  .m-input:disabled,
  .m-select:disabled,
  .m-textarea:disabled {
    opacity: .6;
    cursor: not-allowed;
  }
  
  /* ========= フィールド行（商品行など） ========= */
  .m-row {
    display: grid;
    /* 数量ブロックの幅を広げ、状況により可変に */
    grid-template-columns: 1fr minmax(140px, 200px) 40px;
    gap: 10px;
    align-items: center;
  }
  
  .m-row + .m-row {
    margin-top: 10px;
  }
  
  .m-qty {
    display: grid;
    /* ボタンを少し大きく、中央入力を十分確保 */
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
  }
  /* 数量入力欄の可読性を上げる */
  .m-qty .m-input {
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    min-width: 0;           /* 1fr のときの縮み過ぎ防止 */
  }

  .m-btn-icon { min-width: 40px; }  /* タップ領域の確保 */
  
  .m-qty .m-btn-icon {
    width: 36px; height: 36px; line-height: 36px;
    text-align: center;
    border-radius: 10px;
    background: var(--elev);
    border: 1px solid rgba(255,255,255,.06);
  }
  
  input[type="number"].m-input::-webkit-outer-spin-button,
  input[type="number"].m-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  input[type="number"].m-input { -moz-appearance: textfield; min-width: 50px; text-align: center; }
  
  /* 削除チェックをアイコン風に */
  .m-delete {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--subtext);
    font-size: .9rem;
  }
  .m-delete input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--brand);
  }
  
  /* ========= フラッシュ（Railsの notice/alert を想定） ========= */
  .flash {
    position: fixed;
    left: 12px; right: 12px; bottom: calc(62px + env(safe-area-inset-top));
    z-index: 500;
    display: grid; gap: 8px;
  }
  .flash .msg {
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
    font-size: .95rem;
  }
  .flash .notice { background: rgb(223 243 231); border: 1px solid rgba(34,197,94,.4); color: #22c55e; text-align: center; }
  .flash .alert  { background: rgb(247 227 229); border: 1px solid rgba(239,68,68,.45); color: #ef4444; text-align: center; }
  
  /* ========= エラー表示（Railsの error_explanation / field_with_errors） ========= */
  .field_with_errors .m-input,
  .field_with_errors .m-select,
  .field_with_errors .m-textarea {
    border-color: var(--err);
    box-shadow: 0 0 0 3px rgba(239,68,68,.25);
  }
  
  .m-errors {
    margin: 6px 0 0;
    color: #fecaca;
    font-size: .85rem;
  }
  
  /* ========= 固定アクションボタン（親指操作しやすい） ========= */
  .m-cta {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
  }
  
  .m-btn-primary {
    display: inline-flex; justify-content: center; align-items: center;
    width: 100%;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 10px 30px rgba(79,140,255,.35);
    transition: transform .06s ease, filter .15s ease, background .15s ease;
  }
  
  .m-btn-primary:active {
    transform: translateY(1px) scale(.997);
    background: var(--brand-press);
  }
  
  .m-btn-secondary {
    background: var(--elev);
    color: var(--text);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
  }
  
  /* ========= 小さなUI部品 ========= */
  .m-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--elev);
    color: var(--subtext);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 5px;
    padding: 6px 10px;
    font-size: .82rem;
  }
  
  /* ========= セクション見出し ========= */
  .m-section-title {
    font-size: 1rem;
    margin: 6px 0 10px;
    color: var(--subtext);
    display: flex; align-items: center; gap: 8px;
  }
  .m-sep {
    height: 1px; background: rgba(255,255,255,.06);
    margin: 10px 0 6px;
  }
  .m-input {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
  }
  
  .m-btn-primary {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
  }
  
  .m-btn-secondary {
    background: #f1f3f5;
    color: #333;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
  }
  
  /* ========= アニメーション（軽量） ========= */
  @media (prefers-reduced-motion: no-preference) {
    .fade-in { animation: fade-in .25s ease both; }
    @keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  }
  
  /* ========= リンク/ヘルプ ========= */
  a.m-link { color: var(--brand); text-decoration: none; }
  a.m-link:active { opacity: .85; }
  
  /* ========= 印刷干渉回避（スマホはほぼ不要だが念のため） ========= */
  @media print {
    .m-cta, .flash { display: none !important; }
    body { background: #fff; color: #000; }
  }
  .admin-head {
    display:flex; align-items:flex-end; justify-content:space-between; gap:12px;
    margin-bottom: 12px;
  }
  .admin-sub { color: var(--subtext); margin: 4px 0 0; }
  
  .admin-toolbar {
    background: var(--card); border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
  }
  .toolbar-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
  .toolbar-field { flex: 1 1 180px; }
  .toolbar-actions { display:flex; gap:8px; margin-left:auto; }
  
  .table-wrap {
    background: var(--card); border:1px solid rgba(255,255,255,.08);
    border-radius:14px; overflow:hidden;
  }
  .table { width:100%; border-collapse:collapse; }
  .table thead th {
    text-align:left; font-weight:700; padding:12px; background: var(--elev);
    position: sticky; top: 0; z-index: 1;
  }
  .table tbody tr { border-top:1px solid rgba(255,255,255,.06); }
  .table td { padding:12px; vertical-align:middle; }
  
  .cell-name .name { font-weight:700; }
  .tag {
    display:inline-block; padding:4px 8px; border-radius:5px;
    background: rgba(59,130,246,.12); color:#3b82f6; font-weight:600; font-size:.85rem;
  }
  .tag-soft {
    background: rgba(148,163,184,.15); color:#475569;
  }
  
  .status {
    display:inline-block; padding:4px 10px; border-radius:5px; font-weight:700; font-size:.85rem;
  }
  .status-on  { background: rgba(16,185,129,.15); color:#10b981; border:1px solid rgba(16,185,129,.35); }
  .status-off { background: rgba(239,68,68,.14); color:#ef4444; border:1px solid rgba(239,68,68,.35); }
  
  .truncate { max-width: 220px; }
  .truncate .note { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .muted { opacity:.5; }
  
  .actions { white-space:nowrap; }
  
  /* Buttons */
  .btn { display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:10px 14px; border-radius:10px; font-weight:700; border:1px solid transparent;
    text-decoration:none;
  }
  .btn-primary  { background:#0b66ff; color:#fff; box-shadow:0 6px 16px rgba(11,102,255,.2); }
  .btn-secondary{ background:#f1f3f5; color:#111; }
  .btn-ghost    { background:transparent; color:#444; border-color:#e5e7eb; }
  .btn-mini     { padding:6px 10px; font-size:.9rem; border:1px solid #e5e7eb; border-radius:8px; }
  
  .input {
    width:100%; padding:10px 12px; border-radius:10px; line-height: 20px;
    border:1px solid #e5e7eb; background:#f8fafc;
  }
  
  /* Responsive */
  @media (max-width: 640px) {
    .admin-head { flex-direction:column; align-items:stretch; }
    .toolbar-actions { width:100%; justify-content:flex-end; }
    .table thead th:nth-child(4), .table tbody td:nth-child(4) { display:none; } /* 備考列を隠して簡潔に */
  }
  /* テーブルの1行ホバー */
  .table tbody tr:hover { background: rgba(59,130,246,.06); }
  
  /* 管理リンクのアクセント（上部ナビの青リンク） */
  .m-link.name { font-weight:700; }

  .summary-row { display:grid; grid-template-columns: repeat(2,1fr); gap:10px; margin:12px 0; }
  .summary-tile { background: var(--card); border:1px solid rgba(0,0,0,.08); border-radius:14px; padding:12px; }
  .summary-tile .label { font-size:.9rem; color: var(--subtext); }
  .summary-tile .value { font-weight:800; font-size:1.4rem; }
  
  .order-card-list { display:grid; gap:10px; }
  .order-card {
    background: var(--card); border:1px solid rgba(0,0,0,.08);
    border-radius:16px; padding:12px; box-shadow: var(--shadow);
  }
  
  .order-card-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
  .badge-building {
    background: rgba(59,130,246,.12); color:#3b82f6; border:1px solid rgba(59,130,246,.25);
    font-weight:700; padding:6px 10px; border-radius:5px;
  }
  
  .order-card-customer .name { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
  .chip { background: rgba(148,163,184,.15); color:#475569; padding:4px 8px; border-radius:5px; font-weight:600; }
  .muted { opacity:.65; }
  
  .order-card-items { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
  .pchip { display:inline-flex; align-items:baseline; gap:6px; padding:6px 10px;
    background: var(--elev); border:1px solid rgba(0,0,0,.06); border-radius:5px; }
  .pname { font-weight:700; }
  .pqty { font-variant-numeric: tabular-nums; opacity:.9; }
  
  .order-card-note {
    background: rgba(255,255,255,.6); border:1px dashed rgba(0,0,0,.15);
    border-radius:12px; padding:8px 10px; color: var(--subtext);
  }
  
  .order-card-actions { margin-top:8px; display:flex; gap:8px; justify-content:flex-end; }
  .btn-danger { background: rgba(239,68,68,.12); color:#ef4444; border:1px solid rgba(239,68,68,.35); }
  .empty { text-align:center; color: var(--subtext); padding:20px 0; }
  
  /* 小画面での最適化 */
  @media (max-width: 420px) {
    .summary-row { grid-template-columns: 1fr; }
    .order-card-actions { justify-content:stretch; }
    .btn-danger { width:100%; }
  }
  .m-reserves{
    padding:20px;
  }
  .actions{display:flex;}
  .actions a{margin-right:5px;}

  #chartDaily {
    height: 300px !important; /* 適宜調整 */
  }
  
  .order-card canvas {
    display: block;
    width: 100% !important;
    height: 300px !important;
  }
  /* 横一列レイアウト */
  .orders-table {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }
  
  .order-row {
    display: flex;
    align-items: flex-start;      /* ← 改行行でも崩れないように変更 */
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
    line-height: 1.4;
    min-height: 38px;
  }
  .order-row:last-child { border-bottom: 0; }
  
  .order-row-head {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
  }
  
  /* 各カラム設定 */
  .col-building { flex: 0 0 120px; font-weight: 600; color: #2563eb; }
  .col-date     { flex: 0 0 110px; color: #475569; }
  .col-user     { flex: 0 0 260px; white-space: normal; word-break: break-all; }  /* ← 修正 */
  .col-items    { flex: 1 1 auto;  white-space: normal; word-break: break-all; }   /* ← 修正 */
  .col-actions  { flex: 0 0 84px;  text-align: right; }
  
  .col-user .meta { display: inline-block; margin-left: 6px; color: #94a3b8; font-size: 12px; }
  .col-items .note { color: #64748b; margin-left: 4px; }
  
  .order-empty { padding: 16px; color: #94a3b8; text-align: center; }
  
  /* 既存のボタンと馴染むミニ取消 */
  .btn-mini.btn-danger,
  .btn-danger.btn-mini {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12.5px;
  }
  .btn-mini.btn-danger:hover { background: #fecaca; }

  .app-nav{
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid #eef2f7;
  }
  .app-nav .nav-inner{
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr auto auto;
    align-items: center; gap: 12px;
    padding: 10px 16px;
  }
  .brand-link{
    font-weight: 800; letter-spacing:.2px; color:#0f172a; text-decoration:none;
  }
  .brand-link:hover{ opacity:.85; }
  
  /* links (pill) */
  .nav-links{
    display:flex; gap:8px; align-items:center;
    padding:2px; background:#f8fafc; border-radius:999px;
    border:1px solid #eef2f7;
  }
  .nav-link{
    position:relative; display:inline-flex; align-items:center;
    padding:8px 12px; border-radius:999px;
    color:#334155; text-decoration:none; font-weight:600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
  }
  .nav-link:hover{ background:#eaf2ff; color:#1d4ed8; transform: translateY(-1px); }
  .nav-link.is-active{ color:#0f172a; background:#e8eefc; }
  .nav-link.is-active::after{
    content:""; position:absolute; left:12px; right:12px; bottom:4px;
    height:2px; border-radius:2px; background: linear-gradient(90deg,#2563eb,#7c3aed);
  }
  
  /* right actions */
  .nav-actions{ display:flex; gap:8px; justify-self:end; }
  .btn-ghost{
    padding:8px 12px; border-radius:10px; border:1px solid #e5e7eb;
    background:#fff; color:#111827; text-decoration:none; font-weight:600;
    cursor:pointer; transition: background .2s ease, border-color .2s ease;
  }
  .btn-ghost:hover{ background:#f3f4f6; border-color:#d1d5db; }
  
  /* responsive */
  @media (max-width: 860px){
    .app-nav .nav-inner{ grid-template-columns: 1fr; gap:10px; }
    .nav-links{ flex-wrap: wrap; border-radius:14px; }
    .nav-link{ border-radius:12px; }
    .nav-actions{ justify-self:start; }
  }
  .app-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid #eef2f7;
  }
  
  .app-nav .nav-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
  }
  
  /* ブランド */
  .brand-link {
    font-weight: 800;
    letter-spacing: .2px;
    color: #0f172a;
    text-decoration: none;
  }
  .brand-link:hover { opacity: .85; }
  
  /* リンクグループ */
  .nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 2px;
    background: #f8fafc;
    border-radius: 999px;
    border: 1px solid #eef2f7;
    height: 40px; /* ← 高さ固定 */
  }
  
  /* 個別リンク */
  .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;              /* ← 統一高さ */
    padding: 0 16px;           /* ← 上下は0 */
    border-radius: 18px;       /* ← ピル型 */
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    line-height: 1;            /* ← テキスト高さを安定化 */
  }
  .nav-link:hover {
    background: #eaf2ff;
    color: #1d4ed8;
    transform: translateY(-1px);
  }
  .nav-link.is-active {
    color: #0f172a;
    background: #e8eefc;
  }
  .nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 5px;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg,#2563eb,#7c3aed);
  }
  
  /* ログアウトボタンなど右側 */
  .nav-actions {
    display: flex;
    gap: 8px;
    justify-self: end;
    align-items: center;
  }
  .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;             /* ← nav-link と合わせる */
    padding: 0 16px;          /* ← 同じ左右余白 */
    border-radius: 18px;      /* ← 同じ丸み */
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
    line-height: 1;
  }
  .btn-ghost:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
  }
  
  /* スマホ対応 */
  @media (max-width: 860px) {
    .app-nav .nav-inner { grid-template-columns: 1fr; gap: 10px; }
    .nav-links { flex-wrap: wrap; height: auto; }
    .nav-link, .btn-ghost { height: 34px; border-radius: 14px; }
  }
  .app-nav{
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid #eef2f7;
  }
  
  .app-nav .nav-inner{
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr auto auto;
    align-items: center; gap: 12px;
    padding: 10px 16px;
  }
  
  /* brand */
  .brand-link{
    font-weight: 800; letter-spacing:.2px;
    color:#0f172a; text-decoration:none;
  }
  .brand-link:hover{ opacity:.85; }
  
  /* group */
  .nav-links{
    display:flex; align-items:center; gap:6px;
    padding: 2px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius: 5px;       /* ← 指定通り5px */
    height: 40px;             /* ← グループ外枠の高さ */
  }
  
  /* item */
  .nav-link{
    display:inline-flex; align-items:center; justify-content:center;
    height: 36px;             /* ← 統一高さ */
    padding: 0 8px;          /* ← 上下0で縦中央を安定 */
    border-radius: 5px;       /* ← 指定通り5px */
    color:#334155; text-decoration:none; font-weight:600;
    line-height: 1;
    font-size: 15px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
  }
  .nav-link:hover   { background:#eaf2ff; color:#1d4ed8; transform: translateY(-1px); }
  .nav-link.is-active{ background:#e8eefc; color:#0f172a; }
  .nav-link.is-active::after{ content:none; } /* インジケータ不要なら無効 */
  
  /* right actions */
  .nav-actions{ display:flex; gap:8px; justify-self:end; align-items:center; }
  .btn-ghost{
    display:inline-flex; align-items:center; justify-content:center;
    height: 36px; padding: 0 14px;
    border-radius: 5px;       /* ← 指定通り5px */
    border:1px solid #e5e7eb; background:#fff;
    color:#111827; font-weight:600; text-decoration:none;
    line-height:1; cursor:pointer;
    transition: background .2s ease, border-color .2s ease;
  }
  .btn-ghost:hover{ background:#f3f4f6; border-color:#d1d5db; }
  
  /* responsive */
  @media (max-width: 860px){
    .app-nav .nav-inner{ grid-template-columns: 1fr; gap:10px; }
    .nav-links{ flex-wrap: wrap; height: auto; padding: 4px; }
    .nav-link, .btn-ghost{ height: 34px; } /* 小画面は少し低く */
  }
  .admin-toolbar {
    background: var(--card);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .toolbar-row + .toolbar-row { margin-top: 8px; }   /* 段間の間隔 */
  .toolbar-row--secondary { /* 2段目は行を少し詰める */
    padding-top: 2px;
  }
  
  .toolbar-field { flex: 1 1 180px; min-width: 180px; }
  .toolbar-shortcuts { display:flex; flex-wrap:wrap; gap:6px; }
  .toolbar-actions  { display:flex; gap:8px; margin-left:auto; }
  
  /* 小画面では2段目の右側ボタンを折り返して右寄せ */
  @media (max-width: 860px){
    .toolbar-actions { width: 100%; justify-content: flex-end; }
  }
  .brand-link--app{
    display:flex; align-items:center; gap:10px;
    text-decoration:none; color:#0f172a;
  }
  
  .brand-mark{
    display:inline-grid; place-items:center;
    width:34px; height:34px;
 
    color:#2155ff;                           /* svg の stroke 色 */
 
  }
  
  .brand-text{ display:flex; flex-direction:column; line-height:1.05; }
  .brand-title{
    font-family: var(--font); letter-spacing:.02em;
    font-size: 18px; color:#0f172a;
  }
  .brand-sub{
    font-weight: 600; letter-spacing:.02em;
    font-size: 12px; color:#64748b; margin-top:2px;
  }
  
  /* hover の軽い浮遊感（色は変えず影だけ） */
  .brand-link--app:hover .brand-mark{ box-shadow: 0 6px 16px rgba(33,85,255,.24); }
  
  /* 小画面ではサブを隠してコンパクトに */
  @media (max-width: 860px){
    .brand-sub{ display:none; }
    .brand-title{ font-size: 17px; }
    .brand-mark{ width:32px; height:32px; }
  }
  /* =====================
   スマホ向けログイン画面
   ===================== */
  .m-login {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    background: #f9fbff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Noto Sans JP", sans-serif;
  }
  
  /* --- ヘッダー --- */
  .m-login-header {
    text-align: center;
    margin-bottom: 24px;
  }
  
  .m-login-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: linear-gradient(145deg, #e8f0ff, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    box-shadow: 0 6px 14px rgba(37,99,235,0.15);
    margin: 0 auto 10px;
  }
  
  .m-login-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
  }
  
  .m-login-desc {
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 6px;
  }
  
  /* --- カード --- */
  .m-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.08);
    width: 100%;
    padding: 20px 22px;
  }
  
  .m-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
    color: #1e293b;
  }
  
  /* --- フィールド --- */
  .m-field {
    margin-bottom: 14px;
  }
  
  .m-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
  }
  
  .m-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.2s ease;
  }
  
  .m-input:focus {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
    outline: none;
  }
  
  /* --- チェックボックス --- */
  .m-field-remember {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 2px;
    font-size: 13px;
    color: #475569;
  }
  
  .m-field-remember input {
    margin-right: 6px;
  }
  
  /* --- ボタン --- */
  .btn.btn-primary.m-btn-login {
    width: 100%;
    font-weight: 800;
    padding: 12px 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(37,99,235,0.2);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
  }
  
  .btn.btn-primary.m-btn-login:hover {
    filter: brightness(1.05);
  }
  
  .btn.btn-primary.m-btn-login:active {
    transform: scale(0.98);
  }
  
  /* --- フッター --- */
  .m-login-footer {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 32px;
  }
  
  /* --- スマホ専用微調整 --- */
  @media (max-width: 480px) {
    .m-login {
      padding: 24px 16px 40px;
    }
    .m-card {
      padding: 18px 18px;
    }
    .m-login-title {
      font-size: 18px;
    }
    .m-login-icon {
      width: 48px;
      height: 48px;
    }
  }
  .m-row{
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 44px 96px 44px; /* 商品 / - / 数量 / + */
    gap: 10px;
    align-items: center;
  }
  
  /* スマホ：商品名をさらに優先し、数量はコンパクトに */
  @media (max-width: 480px){
    .m-row{
      grid-template-columns: minmax(240px, 1fr) 40px minmax(84px, 100px) 40px;
      gap: 8px;
    }
    .m-select{
      max-width: 100%;
      /* ネイティブ矢印の余白を詰める（あなたの既存 .m-select の背景矢印と整合） */
      padding-right: 28px !important;
      font-size: 16px; /* iOSの拡大抑止 */
    }
  }
  
  /* かなり狭い端末（≤360px）は2段にスタック：上=商品名、下= - 数量 + */
  @media (max-width: 360px){
    .m-row{
      grid-template-columns: 1fr; /* 1列 */
    }
    /* 2段目の - [数量] + を整列 */
    .m-qty{
      display: grid;
      grid-template-columns: 44px 1fr 44px;
      gap: 8px;
      margin-top: 8px;
    }
  }
  
  /* 入力部品の微調整（はみ出し防止＆タップしやすさ） */
  .m-select, .m-input{
    box-sizing: border-box;
    width: 100%;
  }
  
  /* “行を追加”ボタンは行末で折り返さず全幅に */
  @media (max-width: 480px){
    .m-add-row, .m-add-row .btn{ width: 100%; }
  }
  .history{ max-width: 760px; margin: 0 auto; padding: 10px 14px 24px; }
  .history-title{ margin: 2px 0 6px; font-size: 22px; font-weight: 900; color:#0f172a; }
  .history-lead{ margin: 0 0 12px; color:#64748b; font-size: 13.5px; }
  
  .h-list{ list-style:none; margin:0; padding:0; display:grid; gap:12px; }
  
  .h-card{
    background:#fff; border:1px solid #e5e7eb; border-radius:12px;
    padding:12px; box-shadow:0 10px 28px rgba(15,23,42,.06);
  }
  
  /* ---- ヘッダのチップ ---- */
  .h-head{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:8px; }
  .h-chip{
    display:inline-flex; align-items:center; gap:6px;
    padding:6px 10px; border-radius:6px; font-weight:700; font-size:12.5px;
    line-height:1; border:1px solid transparent;
  }
  .h-building{ background: rgba(37,99,235,.10); color:#2563eb; border-color: rgba(37,99,235,.28); }
  .h-date{ background:#f8fafc; color:#334155; border-color:#e2e8f0; }
  .h-status--active{ background: rgba(16,185,129,.12); color:#059669; border-color: rgba(16,185,129,.35); }
  .h-status--cancel{ background: rgba(239,68,68,.12); color:#ef4444; border-color: rgba(239,68,68,.35); }
  
  /* ---- 利用者・勤務先建物・内線 ---- */
  .h-meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:6px; }
  .h-name{ font-size:15px; color:#111827; }
  .h-dept{ background: rgba(148,163,184,.15); color:#475569; border-color: rgba(148,163,184,.25); }
  .h-contact{ color:#94a3b8; font-size:12.5px; }
  
  /* ---- アイテム行 ---- */
  .h-items{ display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
  .h-item{
    display:inline-flex; align-items:baseline; gap:6px;
    padding:6px 10px; border-radius:6px;
    background:#f7f9fc; color:#0f172a; border:1px solid #e2e8f0;
  }
  .h-item__name{ font-weight:800; }
  .h-item__qty{ opacity:.85; font-variant-numeric: tabular-nums; }
  
  /* ---- 備考 ---- */
  .h-note-box{
    margin-top:4px; color:#64748b; font-size:13px;
    padding:8px 10px; border-radius:8px;
    background:#fafbff; border:1px dashed #dbe3ff;
  }
  
  /* ---- アクション ---- */
  .h-actions{ display:flex; gap:8px; justify-content:flex-end; align-items:center; margin-top:10px; }
  .h-btn{
    height:36px; padding:0 14px; border-radius:8px;
    font-weight:800; font-size:14px;
  }
  .btn.btn-ghost{
    background:#fff; color:#111827; border:1px solid #e5e7eb;
  }
  .btn.btn-danger{
    background: rgba(239,68,68,.12); color:#b91c1c; border:1px solid #fca5a5;
  }
  .h-muted{ color:#94a3b8; font-size:12.5px; }
  
  /* ---- 空表示 ---- */
  .h-empty{
    text-align:center; color:#94a3b8; background:#fff;
    border:1px dashed #e5e7eb; border-radius:12px; padding:20px;
  }
  
  /* ---- さらにモバイルで詰める ---- */
  @media (max-width: 420px){
    .h-card{ padding:10px; }
    .h-btn{ height:34px; padding:0 12px; border-radius:7px; }
    .h-item{ padding:6px 8px; }
  }
  .history-summary{
    display:flex; align-items:center; justify-content:space-between;
    background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px;
    padding:10px 12px; margin: 0 0 12px;
    color:#334155; font-weight:600;
  }
  .history-summary__amount{
    font-size: 18px; font-weight: 900; color:#0f172a;
  }
  
  /* 金額チップ（各予約） */
  .h-amount{
    background:#fff; color:#111827;
    border-color:#e5e7eb;
  }
  .history.v2{ max-width: 760px; margin: 0 auto; padding: 10px 14px 24px; }
  .h2-title{ margin:2px 0 6px; font-size:22px; font-weight:900; color:#0f172a; }
  .h2-lead{ margin:0 0 12px; color:#64748b; font-size:13.5px; }
  
  /* 小計バー */
  .h2-total{
    display:flex; align-items:center; justify-content:space-between;
    background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px;
    padding:10px 12px; margin:0 0 12px;
    color:#334155; font-weight:600;
  }
  .h2-total strong{ font-size:18px; font-weight:900; color:#0f172a; }
  
  /* リスト */
  .h2-list{ list-style:none; margin:0; padding:0; display:grid; gap:12px; }
  .h2-card{
    background:#fff; border:1px solid #e5e7eb; border-radius:12px;
    padding:12px; box-shadow:0 10px 28px rgba(15,23,42,.06);
  }
  
  /* ヘッダ */
  .h2-head{
    display:grid; grid-template-columns: 1fr auto; gap:8px; align-items:start;
    border-bottom: 1px dashed #eef2f7; padding-bottom:8px; margin-bottom:8px;
  }
  .h2-head-main{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  .h2-building{ font-weight:800; color:#1d4ed8; }
  .h2-date{ color:#334155; background:#f3f6fb; border:1px solid #e3e8f4; border-radius:6px; padding:4px 8px; }
  
  .h2-head-side{ display:flex; align-items:center; gap:8px; }
  .h2-amount{
    font-weight:900; color:#0f172a; background:#fff;
    border:1px solid #e5e7eb; border-radius:8px; padding:6px 10px;
  }
  .h2-status{
    border-radius:8px; padding:6px 10px; font-weight:800; font-size:12.5px;
    border:1px solid transparent;
  }
  .h2-status.is-active{ color:#059669; background:rgba(16,185,129,.1); border-color:rgba(16,185,129,.3); }
  .h2-status.is-cancel{ color:#ef4444; background:rgba(239,68,68,.1); border-color:rgba(239,68,68,.3); }
  
  /* メタ */
  .h2-meta{ color:#64748b; display:flex; flex-wrap:wrap; gap:4px 6px; align-items:center; }
  .h2-name{ color:#0f172a; font-weight:800; }
  .h2-meta .dot{ opacity:.4; }
  
  /* 品目 */
  .h2-items{ display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
  .h2-pill{
    display:inline-flex; align-items:baseline; gap:6px;
    background:#f7f9fc; border:1px solid #e2e8f0; border-radius:8px; padding:6px 10px;
  }
  .h2-pill .nm{ font-weight:800; color:#0f172a; }
  .h2-pill .qt{ opacity:.9; font-variant-numeric: tabular-nums; }
  
  /* 備考 */
  .h2-note{
    margin-top:4px; color:#475569; font-size:13px;
    background:#fafbff; border:1px dashed #dbe3ff; border-radius:8px; padding:8px 10px;
  }
  
  /* フッタ */
  .h2-actions{ display:flex; gap:8px; justify-content:flex-end; align-items:center; margin-top:10px; }
  .h2-muted{ color:#94a3b8; font-size:12.5px; }
  .btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid transparent; padding:8px 12px; border-radius:8px; font-weight:800; }
  .btn.btn-ghost{ background:#fff; color:#111827; border-color:#e5e7eb; }
  .btn.btn-danger{ background: rgba(239,68,68,.12); color:#b91c1c; border:1px solid #fca5a5; }
  
  /* モバイル最適化 */
  @media (max-width: 420px){
    .h2-head{ grid-template-columns: 1fr; }
    .h2-head-side{ justify-content:space-between; }
    .h2-amount{ padding:6px 8px; }
    .h2-card{ padding:10px; }
  }
  .orders-table .col-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
  }
  
  .orders-table .user-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .orders-table .user-name {
    font-weight: 700;
    color: #111827;
  }
  
  .orders-table .user-sub .meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-right: 6px;
  }
  
  /* --- badge: canceled --- */
  .order-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.6;
    border: 1px solid transparent;
  }
  
  .order-badge.canceled {
    color: #b00020;
    background: #fdecec;
    border-color: #f4b4b4;
  }
  
  /* 印刷時はバッジ非表示（運用上不要なため） */
  @media print {
    .order-badge { display: none !important; }
  }
  /* 折れ線グラフのキャンバス高さ調整 */
  #m-reserve .m-card canvas,
  .m-card canvas {
    width: 100%;
    max-height: 260px;
  }
  .items-table {
    width: 100%;
    border-collapse: collapse;
  }
  .items-table th,
  .items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb; /* 薄い区切り線 */
  }
  .items-table th {
    text-align: left;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
  }
  .items-table td.qty,
  .items-table th.qty {
    width: 7rem;
    text-align: right;     /* 数量は右寄せで視線を揃える */
    font-weight: 700;      /* 少し強調 */
  }
  .m-summary { padding-top: 14px; }
  .kv {
    display: grid;
    grid-template-columns: 10rem 1fr;
    row-gap: 10px;
  }
  .kv-row { display: contents; }
  .kv dt {
    color: #6b7280;            /* グレー500 */
    font-weight: 600;
  }
  .kv dd {
    margin: 0;
    font-size: 1.05rem;
  }
  .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
  
  /* バッジ/チップ */
  .summary-badges { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
  .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: .85rem;
    font-weight: 700;
  }
  .badge--ok     { background: #ecfdf5; color: #065f46; }  /* 緑系 */
  .badge--danger { background: #fee2e2; color: #991b1b; }  /* 赤系 */
  .badge--light  { background: #f3f4f6; color: #374151; }  /* 灰 */
  
  .chip {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    background: #eef2ff;  /* 薄い青 */
    color: #3730a3;
    font-size: .9rem;
    margin-right: 6px;
  }
  .chip--note { background:#fff7ed; color:#9a3412; } /* 備考ラベル色 */
  
  @media print {
    .m-summary { box-shadow: none; background: #fff; }
    .badge, .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  }
  .item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  
  .item-row__select {
    flex: 1 1 250px;
    min-width: 180px;
  }
  
  .item-row__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
  }
  
  .qty-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 18px;
    line-height: 1;
  }
  
  .qty-input {
    width: 60px;
    text-align: center;
    padding: 6px 4px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 16px;
  }
  
  .btn-text.danger {
    color: #dc2626;
    font-size: 14px;
    background: none;
    border: none;
    padding: 4px 8px;
  }
  
  /* スマホ対応 */
  @media (max-width: 520px) {
    .item-row {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }
  
    .item-row__controls {
      justify-content: space-between;
      width: 100%;
    }
  
    .qty-group {
      gap: 8px;
    }
  
    .qty-input {
      width: 70px;
    }
  }
  .item-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px 12px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background-color .5s ease, box-shadow .5s ease;
  }
  
  .item-row__badge { width: 28px; display: flex; justify-content: center; }
  .row-index {
    display: inline-flex;
    min-width: 22px; height: 22px;
    border-radius: 999px; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #eef2ff; color: #4338ca;
  }
  
  .item-row--new { background: #f0f9ff; box-shadow: 0 0 0 2px #bae6fd inset; }
  
  .item-row__select { min-width: 200px; }
  .item-row__controls { display: flex; align-items: center; gap: 10px; }
  
  .qty-group { display: flex; align-items: center; gap: 6px; }
  .btn-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #d1d5db; background:#fff; }
  .qty-input { width: 64px; text-align:center; border:1px solid #d1d5db; border-radius:8px; padding:6px 4px; }
  .btn-text.danger { color:#dc2626; background:none; border:none; padding:4px 8px; }
  
  @media (max-width: 520px) {
    .item-row {
      grid-template-columns: auto 1fr;
      grid-template-areas:
        "badge select"
        ".     controls";
    }
    .item-row__badge   { grid-area: badge; }
    .item-row__select  { grid-area: select; }
    .item-row__controls{ grid-area: controls; justify-content: space-between; }
  }
  .h2-filter{display:flex;gap:8px;margin:10px 0 8px}
  .chip{display:inline-flex;align-items:center;padding:6px 10px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;color:#334155;font-weight:600;text-decoration:none}
  .chip.is-on{background:#e8eefc;border-color:#c7d2fe;color:#1d4ed8}
  
  .h2-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:8px 0 12px}
  .h2-summary .box{background:#fff;border:1px solid #eef2f7;border-radius:8px;padding:8px 10px}
  .h2-summary .box .label{font-size:.85rem;color:#64748b}
  .h2-summary .box .value{font-weight:800}
  .h2-summary .box.muted{opacity:.7}
  
  /* カード状態 */
  .h2-card{position:relative;background:#fff;border:1px solid #eef2f7;border-radius:12px;padding:12px;margin-bottom:10px}
  .h2-card.is-cancel{opacity:.6;filter:grayscale(0.15)}
  .h2-card.is-cancel .h2-pill{background:#f7f7f7}
  .h2-card .ribbon{
    position: absolute;
    top: 50px;
    left: 0;
    background: #fee2e2;
    color: #b91c1c;
    padding: 16px 14px;
    font-weight: 800;
    font-size: 18px;
    border: 2px solid #fecaca;
    right: 0;
    text-align: center;
    border-radius: 5px;
    width: 115px;
    margin: 0 auto;
  }
  
  /* 金額/バッジ */
  .h2-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
  .h2-amount{font-weight:800}
  .h2-amount.muted{color:#64748b}
  .h2-badge{display:inline-flex;align-items:center;font-weight:700;border-radius:999px;padding:3px 8px;font-size:.78rem;margin-left:6px}
  .badge-active{background:rgba(16,185,129,.14);color:#10b981;border:1px solid rgba(16,185,129,.35)}
  .badge-cancel{background:#fff5f5;color:#ef4444;border:1px solid #fecaca}
  /* ログイン方法トグル */
.login-mode-block {
  margin-bottom: 16px;
}

.login-mode-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111827;
}

.login-mode-pills {
  display: flex;
  gap: 8px;
}

.login-mode-pill {
  flex: 1;
  position: relative;
  cursor: pointer;
  border-radius: 999px;
  overflow: hidden;
}

/* 本体 */
.login-mode-pill .pill-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 14px 8px 34px;
  border-radius: 999px;
  background: #f3f4ff;
  border: 1px solid #e5e7eb;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, color 0.18s ease;
  font-size: 0.85rem;
}

/* ラジオボタンは非表示にして、見た目は pill-body 側で表現 */
.login-mode-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-mode-pill .pill-main {
  font-weight: 600;
  color: #111827;
}

.login-mode-pill .pill-sub {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 左側の丸いインジケータ */
.login-mode-pill .pill-body::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #9ca3af;
  background: #ffffff;
  box-sizing: border-box;
}

/* 選択時のスタイル */
.login-mode-radio:checked + .pill-body {
  background: #2563eb;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.login-mode-radio:checked + .pill-body .pill-main {
  color: #ffffff;
}

.login-mode-radio:checked + .pill-body .pill-sub {
  color: rgba(249, 250, 251, 0.9);
}

/* 選択時の丸 */
.login-mode-radio:checked + .pill-body::before {
  border-color: #bfdbfe;
  background: radial-gradient(circle at center, #ffffff 0, #ffffff 45%, #2563eb 46%, #2563eb 100%);
}

/* ホバー時 */
@media (hover: hover) {
  .login-mode-pill .pill-body:hover {
    border-color: #c4c8ff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  }
}

/* スマホでの余白調整 */
@media (max-width: 480px) {
  .login-mode-pill .pill-body {
    padding: 8px 10px 8px 32px;
  }
  .login-mode-pill .pill-sub {
    font-size: 0.7rem;
  }
}
  
.order-badge.retired {
  background: #f23232;
  color: white;
  border-radius: 999px;
  padding: 0px 8px;
  font-size: 10px;
  margin-left: 4px;
  line-height: 16px;
  font-weight: normal;
  vertical-align: text-top;
}
.product-summary-row {
  margin-top: 16px;
}

.summary-tile--full {
  flex: 1 1 100%;
}

.product-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.product-summary-table th,
.product-summary-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}

.product-summary-table th {
  font-weight: 600;
  color: #555;
}

.product-summary-table .align-right {
  text-align: right;
}
.product-summary-block {
  margin-bottom: 12px;
}

.product-summary-block .summary-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}

.product-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.product-summary-table th,
.product-summary-table td {
  padding: 3px 6px;
  border: 1px solid #ccc;
}

.product-summary-table .ta-r {
  text-align: right;
}

.section-separator {
  border: none;
  border-top: 1px solid #999;
  margin: 8px 0 10px;
}
.notice-banner {
  margin-bottom: 16px;
  border-left: 4px solid #2563eb;
}

.notice-banner__label {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 4px;
}

.notice-banner__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.notice-banner__body {
  font-size: 13px;
  line-height: 1.5;
}
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0px;
  padding: 20px 24px;
  border-radius: 14px;
  background: #fff7e6; /* 柔らかい黄色（注意・お知らせカラー） */
  border: 1px solid #ffe3b0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 28px;
  animation: slideDown 0.35s ease-out;
  flex-direction: column;
}

.notice-icon {
  font-size: 28px;
  line-height: 1;
  margin-top: 2px;
}

.notice-body {
  flex: 1;
}

.notice-title {
  font-size: 18px;
  font-weight: 700;
  color: #c15a00; /* 濃いオレンジ */
  margin-bottom: 6px;
}

.notice-content {
  font-size: 15px;
  color: #333;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.orders-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.order-row {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e3e7f1;
  padding: 10px 12px;
}

.order-row-head {
  border: none;
  background: transparent;
  padding: 0;
  text-align: center;
  padding-top: 10px;
}

/* ============== スマホ向け（幅 768px 以下） ============== */

@media (max-width: 768px) {
  /* 画面全体の左右余白を少し詰める */
  .m-reserves {
    padding: 12px 10px 24px;
  }
  .order-row {
    display: grid;
  }

  /* ツールバー全体 */
  .admin-toolbar form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .toolbar-row,
  .toolbar-row.toolbar-row--secondary {
    flex-direction: row;
    align-items: stretch;
    gap: 13px;
  }

  .toolbar-field,
  .toolbar-actions {
    width: 100%;
  }

  .toolbar-field .input,
  .toolbar-actions .btn,
  .toolbar-actions .btn-mini {
    width: 100%;
  }

  /* ショートカットボタン横並び → 折り返し */
  .toolbar-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar-shortcuts .btn-mini {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }

  /* サマリータイルは 1 列 */
  .summary-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .summary-tile {
    width: 100%;
  }

  /* ======== 予約一覧（カードレイアウト） ======== */

  .orders-table {
    gap: 10px;
  }

  /* 見出し行はスマホでは非表示 */
  .order-row-head {
    display: none;
  }

  /* 1件＝1カードに見えるように */
  .order-row {
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  }

  /* 各カラムを縦並びに */
  .order-row .col-building,
  .order-row .col-date,
  .order-row .col-user,
  .order-row .col-items,
  .order-row .col-actions {
    display: block;
    width: 100%;
    font-size: 14px;
    margin-bottom: 4px;
  }

  .order-row .col-user {
    margin-top: 6px;
  }

  /* ラベルを ::before で付ける（tableヘッダの代わり） */
  .order-row .col-building::before,
  .order-row .col-date::before,
  .order-row .col-user::before,
  .order-row .col-items::before {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b; /* グレー */
    margin-right: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eef2ff;
  }

  .order-row .col-building::before { content: "配送先"; }
  .order-row .col-date::before     { content: "対象日"; }
  .order-row .col-user::before     { content: "利用者"; }
  .order-row .col-items::before    { content: "内容"; }

  /* 利用者名やキャンセルバッジの見た目調整 */
  .order-row .user-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: 2px;
  }

  .order-row .user-name {
    font-size: 15px;
  }

  .order-row .user-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
  }

  .order-badge.canceled {
    font-size: 11px;
    padding: 2px 6px;
  }

  /* 備考などは少し薄く */
  .order-row .note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
  }

  /* キャンセルボタンはカード下部に右寄せで */
  .order-row .col-actions {
    margin-top: 8px;
    text-align: right;
  }

  .order-row .col-actions .btn {
    width: auto;
    min-width: 90px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }
}
html, body {
  touch-action: manipulation;
}
/* 数量調整ボックス */
.qty-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* プラス・マイナスのボタンデザイン */
.qty-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: #e9ebff;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.qty-btn--plus  { background: #dfe4ff; }
.qty-btn--minus { background: #f2dede; }

.qty-btn:hover {
  transform: scale(1.15);
}

.qty-btn:active {
  transform: scale(0.92);
  opacity: 0.8;
}

/* 数量入力エリア */
.qty-input {
  width: 70px;
  height: 45px;
  text-align: center;
  font-size: 20px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid #ccd2ff;
  background: #fafbff;
}
/* スマホは縦積みにして重なりを防ぐ */
@media (max-width: 600px) {
  .admin-toolbar .toolbar-row:not(.toolbar-row--secondary) {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar .toolbar-row:not(.toolbar-row--secondary) .toolbar-field,
  .admin-toolbar .toolbar-row:not(.toolbar-row--secondary) .toolbar-actions {
    width: 100%;
  }

  .admin-toolbar .toolbar-row:not(.toolbar-row--secondary) .toolbar-actions .btn {
    width: 100%;  /* 「適用」ボタンも横いっぱいにして押しやすく */
  }
}
