/* OCR System — style.css  (professional redesign) */

/* ── Download dropdown ── */
.dl-dropdown{position:relative;display:inline-block}
.dl-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:200;
  background:var(--surface);border:1px solid var(--border2);
  border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);
  min-width:170px;padding:4px 0;white-space:nowrap}
.dl-item{display:block;width:100%;padding:7px 14px;
  background:none;border:none;cursor:pointer;
  font:inherit;font-size:13px;color:var(--text2);text-align:left;
  transition:background .12s}
.dl-item:hover{background:var(--accent-bg);color:var(--accent)}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;scroll-behavior:smooth}

/* ── Design tokens ── */
:root{
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface2:  #f8f9fb;
  --border:    #e2e5ea;
  --border2:   #d0d5dd;
  --text:      #0f1117;
  --text2:     #374151;
  --muted:     #6b7280;
  --subtle:    #9ca3af;
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --accent-bg: #eff6ff;
  --accent-bd: #bfdbfe;
  --danger:    #dc2626;
  --danger-bg: #fef2f2;
  --success:   #16a34a;
  --success-bg:#f0fdf4;
  --warning:   #d97706;
  --warning-bg:#fffbeb;
  --mono:      #374151;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10),0 2px 6px rgba(0,0,0,.06);
  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
}

body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  font-size:14px;line-height:1.5;
  background:var(--bg);color:var(--text);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:3px}

/* ── App shell ── */
.app-shell{display:flex;height:100vh;height:100dvh;overflow:hidden}

/* ── Sidebar ── */
.sidebar{
  width:220px;flex-shrink:0;
  background:#0f172a;color:#94a3b8;
  display:flex;flex-direction:column;
  overflow:hidden;border-right:1px solid #1e293b;
  transition:width .2s ease;
}
.sidebar-logo{
  display:flex;align-items:center;gap:11px;
  padding:18px 14px 16px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.sidebar-brand-info{min-width:0;flex:1}
.sidebar-logo-mark{
  width:34px;height:34px;border-radius:9px;
  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;font-size:11px;font-weight:700;letter-spacing:.02em;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  box-shadow:0 2px 8px rgba(37,99,235,.4);
}
.sidebar-logo-text{font-size:14px;font-weight:600;color:#f1f5f9;letter-spacing:-.01em;white-space:nowrap}
.sidebar-logo-sub{font-size:10px;color:#64748b;margin-top:1px;white-space:nowrap}
.sidebar-toggle-btn{
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);
  color:#94a3b8;width:28px;height:28px;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;flex-shrink:0;transition:background .12s,color .12s;
}
.sidebar-toggle-btn:hover{background:rgba(255,255,255,.14);color:#f1f5f9}

/* Collapsed sidebar on desktop */
.app-shell.sidebar-collapsed .sidebar{width:64px}
.app-shell.sidebar-collapsed .sidebar-logo{flex-direction:column;gap:10px;padding:14px 8px;justify-content:center}
.app-shell.sidebar-collapsed .sidebar-brand-info,
.app-shell.sidebar-collapsed .sidebar-section-label,
.app-shell.sidebar-collapsed .nav-item span{display:none}
.app-shell.sidebar-collapsed .nav-item{justify-content:center;padding:10px}
.app-shell.sidebar-collapsed .order-preview{left:64px}

.sidebar-nav{display:flex;flex-direction:column;gap:2px;padding:14px 10px}
.sidebar-section-label{
  font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
  color:#475569;padding:8px 10px 4px;
}
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 12px;border-radius:var(--radius-sm);border:none;
  font-size:13px;font-weight:500;cursor:pointer;
  color:#94a3b8;background:transparent;font-family:inherit;
  text-align:left;transition:background .12s,color .12s;width:100%;
}
.nav-item:hover{background:rgba(255,255,255,.06);color:#e2e8f0}
.nav-item.active{background:rgba(59,130,246,.18);color:#60a5fa}
.nav-item svg{flex-shrink:0}

/* ── Main area ── */
.main-area{flex:1;min-width:0;overflow-y:auto;overflow-x:hidden;background:var(--bg)}

/* ── Views ── */
.view{min-height:100%}
.view.hidden{display:none}

/* ── Page (Home) ── */
.page{max-width:740px;margin:0 auto;padding:0 20px 60px}

/* ── Top bar ── */
.header{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;gap:12px;
  padding:13px 20px;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
  margin-bottom:0;
}
.header-logo{font-weight:700;font-size:15px;color:var(--text);letter-spacing:-.01em}
.header-engines{display:flex;gap:6px;margin-left:auto;flex-wrap:wrap}
.engine-badge{
  display:flex;align-items:center;gap:5px;
  padding:3px 9px;border-radius:20px;
  font-size:11px;font-weight:500;
  background:var(--surface);color:var(--muted);
  border:1px solid var(--border);
}
.engine-dot{width:5px;height:5px;border-radius:50%;background:var(--success);flex-shrink:0}

/* Section spacing */
.section{padding:20px 0 0}

/* ── Cards ── */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:22px;margin-bottom:16px;
  box-shadow:var(--shadow-sm);
}
.card-title{
  font-size:13px;font-weight:600;color:var(--text);
  margin-bottom:16px;letter-spacing:-.01em;
}

/* ── Drop zone ── */
.drop-zone{
  border:2px dashed var(--border2);border-radius:var(--radius);
  padding:36px 16px;text-align:center;cursor:pointer;position:relative;
  transition:border-color .15s,background .15s;background:var(--surface2);
}
.drop-zone:hover,.drop-zone.drag-over{border-color:var(--accent);background:var(--accent-bg)}
.drop-zone input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
.drop-icon{color:var(--subtle);margin-bottom:12px}
.drop-title{font-size:14px;font-weight:500;color:var(--text2)}
.drop-link{color:var(--accent)}
.drop-hint{font-size:11px;color:var(--subtle);margin-top:6px}

/* ── File preview ── */
.preview-area{
  display:flex;align-items:flex-start;gap:12px;
  padding:12px 14px;border-radius:var(--radius-sm);
  border:1px solid var(--border);background:var(--surface2);margin-top:14px;
}
.file-icon{
  width:44px;height:44px;border-radius:var(--radius-sm);border:1px solid var(--border);
  background:var(--surface);flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-size:9px;font-weight:700;color:var(--muted);flex-direction:column;gap:2px;
}
.file-thumb{width:44px;height:44px;object-fit:contain;border-radius:var(--radius-sm);border:1px solid var(--border);flex-shrink:0}
.file-info{flex:1;min-width:0}
.file-name{font-size:13px;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-meta{font-size:11.5px;color:var(--muted);margin-top:2px}

/* ── Upload Client OCR Selector ── */
.upload-client-section{
  margin-top:16px;padding:12px 14px;
  border:1px solid var(--border);border-radius:var(--radius);
  background:var(--surface2);
}
.upload-client-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.upload-client-controls{display:flex;align-items:center;gap:6px;flex:1;min-width:220px;flex-wrap:wrap}
.upload-client-select{
  flex:1;min-width:200px;padding:6px 10px;
  border:1px solid var(--border2);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text);
  font-size:12.5px;font-weight:500;font-family:inherit;outline:none;cursor:pointer;
  transition:border-color .12s,box-shadow .12s;
}
.upload-client-select:focus{border-color:var(--accent);box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.upload-client-preview{
  margin-top:10px;padding:10px 12px;
  border:1px solid var(--accent-bd);border-radius:var(--radius-sm);
  background:var(--surface);
}
.upload-client-preview-top{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px;
}
.upload-client-mode-badge{
  display:inline-flex;align-items:center;gap:4px;
  padding:2px 8px;border-radius:20px;font-size:10.5px;font-weight:600;
  background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;
}
.upload-client-mode-badge.mode-manual{
  background:#eef2ff;color:#4338ca;border-color:#c7d2fe;
}
.upload-client-mode-badge.mode-auto{
  background:#ecfdf5;color:#047857;border-color:#a7f3d0;
}
.upload-client-name{font-size:12.5px;font-weight:600;color:var(--text)}
.upload-client-cols{display:flex;align-items:center;gap:5px;flex-wrap:wrap}

/* ── Engine selector ── */
.engine-row{display:flex;align-items:center;gap:10px;margin-top:16px;flex-wrap:wrap}
.engine-label{font-size:12px;color:var(--muted);white-space:nowrap;font-weight:500}
.toggle-group{display:flex;gap:6px;flex-wrap:wrap}
.toggle{
  padding:5px 12px;border-radius:var(--radius-sm);
  border:1px solid var(--border);
  font-size:12px;font-weight:500;cursor:pointer;
  background:var(--surface);color:var(--muted);font-family:inherit;
  transition:all .12s;
}
.toggle.active,.toggle:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.toggle.gpu-required{opacity:.5;cursor:not-allowed}
.toggle.gpu-required:hover{background:var(--surface);border-color:var(--border);color:var(--muted)}
.gpu-badge{font-size:10px;color:#f59e0b;font-weight:700;margin-left:2px}

/* ── Buttons ── */
.btn-primary{
  width:100%;margin-top:16px;padding:10px 18px;
  border-radius:var(--radius);border:none;cursor:pointer;
  background:var(--accent);color:#fff;
  font-size:14px;font-weight:600;font-family:inherit;
  display:flex;align-items:center;justify-content:center;gap:7px;
  transition:background .12s,opacity .12s;
  box-shadow:0 1px 3px rgba(37,99,235,.3);
}
.btn-primary:disabled{opacity:.4;cursor:not-allowed;box-shadow:none}
.btn-primary:not(:disabled):hover{background:var(--accent-h)}

@keyframes spin{to{transform:rotate(360deg)}}
.spinner{width:14px;height:14px;border-radius:50%;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;animation:spin .6s linear infinite;flex-shrink:0}

.btn-sm{
  padding:5px 11px;border-radius:var(--radius-sm);
  border:1px solid var(--border);
  font-size:12px;font-weight:500;cursor:pointer;
  background:var(--surface);color:var(--text2);font-family:inherit;
  transition:all .12s;white-space:nowrap;
}
.btn-sm:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-bg)}
.btn-sm:disabled{opacity:.5;cursor:not-allowed}
.btn-sm.btn-save{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-sm.btn-save:hover:not(:disabled){background:var(--accent-h);border-color:var(--accent-h)}
.btn-sm.btn-save.saved{background:var(--success-bg);border-color:#86efac;color:var(--success)}
.btn-sm.btn-danger{color:#dc2626;border-color:#fca5a5;background:#fef2f2;font-weight:600}
.btn-sm.btn-danger:hover:not(:disabled){background:#dc2626;border-color:#dc2626;color:#fff}

/* ── Progress ── */
.progress-wrap{padding:0 2px;margin-bottom:16px}
.progress-track{height:3px;background:var(--border);border-radius:2px;overflow:hidden}
.progress-bar{height:100%;background:var(--accent);border-radius:2px;width:0;transition:width .4s ease}
.progress-label{font-size:11px;color:var(--muted);text-align:center;margin-top:7px}

/* ── Results header ── */
.results-header{display:flex;align-items:center;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.results-title{font-size:13px;font-weight:600;color:var(--text)}
.results-meta{display:flex;gap:5px;flex-wrap:wrap;flex:1}
.results-actions{display:flex;gap:6px;flex-wrap:wrap}

/* ── Results Client OCR Bar ── */
.results-client-bar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 12px;margin-bottom:12px;
  background:#f8fafc;border:1px solid var(--border);border-radius:var(--radius-sm);
  flex-wrap:wrap;
}
.results-client-bar-left{
  display:flex;align-items:center;gap:8px;flex:1;min-width:220px;flex-wrap:wrap;
}
.results-client-cols{
  display:flex;align-items:center;gap:4px;flex-wrap:wrap;flex:1;min-width:160px;
}
.results-client-bar-right{display:flex;align-items:center;gap:6px;flex-shrink:0}

/* ── Pills ── */
.meta-pill{
  padding:2px 8px;border-radius:20px;
  font-size:11px;font-weight:500;
  background:var(--surface2);border:1px solid var(--border);color:var(--muted);
}
.meta-pill.engine{background:var(--accent-bg);color:var(--accent);border-color:var(--accent-bd)}
.meta-pill.client{background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe}
.meta-pill.good{background:var(--success-bg);color:var(--success);border-color:#bbf7d0}
.meta-pill.warn{background:var(--warning-bg);color:var(--warning);border-color:#fde68a}

/* ── Tabs ── */
.tab-bar{display:flex;border-bottom:1px solid var(--border);margin-bottom:16px;overflow-x:auto;scrollbar-width:none}
.tab-bar::-webkit-scrollbar{display:none}
.tab{
  padding:8px 14px;font-size:12px;font-weight:500;cursor:pointer;
  background:transparent;border:none;border-bottom:2px solid transparent;
  color:var(--muted);white-space:nowrap;flex-shrink:0;font-family:inherit;
  transition:color .12s;margin-bottom:-1px;
}
.tab:hover{color:var(--text)}
.tab.active{border-bottom-color:var(--accent);color:var(--accent);font-weight:600}

@keyframes fadeIn{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
.tab-panel{animation:fadeIn .15s ease}

/* ── Text output ── */
.text-out{
  font-family:'Courier New',Consolas,monospace;font-size:12.5px;line-height:1.65;
  color:var(--mono);background:var(--surface2);border:1px solid var(--border);
  border-radius:var(--radius-sm);padding:14px;white-space:pre-wrap;word-break:break-word;
  max-height:380px;overflow-y:auto;
}
.json-out{font-size:11.5px;color:var(--accent)}

/* ── PaddleOCR lines ── */
.lines-list{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}
.line-item{
  display:flex;align-items:center;gap:10px;
  padding:7px 10px;border-radius:var(--radius-sm);
  border:1px solid var(--border);background:var(--surface2);
}
.line-text{flex:1;font-size:12.5px;font-family:'Courier New',monospace;color:var(--mono);min-width:0;word-break:break-word}
.conf-bar-wrap{flex-shrink:0;width:48px;height:3px;background:var(--border);border-radius:2px;overflow:hidden}
.conf-bar{height:100%;border-radius:2px}
.conf-label{flex-shrink:0;font-size:11px;font-weight:500;min-width:34px;text-align:right}
.conf-high{color:var(--success)}
.conf-mid{color:var(--warning)}
.conf-low{color:var(--danger)}

/* ── Extracted tables (OCR result) ── */
/* ── Tables tab ── */
#tab-tables{padding:16px 20px;display:flex;flex-direction:column;gap:20px}

.tbl-empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;padding:60px 20px;color:var(--muted);font-size:13px;text-align:center;
}
.tbl-empty svg{opacity:.3}

.tbl-block{
  border:1px solid var(--border2);border-radius:var(--radius);
  overflow:hidden;background:var(--surface);
  box-shadow:var(--shadow-sm);
}

.tbl-header{
  display:flex;align-items:center;gap:10px;
  padding:10px 14px;
  background:#eef1f6;
  border-bottom:2px solid var(--border2);
}
.tbl-title{
  font-size:13px;font-weight:700;color:var(--text);flex:1;
}
.tbl-meta{
  font-size:11px;color:var(--muted);
  background:var(--surface);border:1px solid var(--border);
  padding:2px 8px;border-radius:10px;font-weight:500;white-space:nowrap;
}

.tbl-scroll{overflow-x:auto}

.tbl-grid{
  width:100%;border-collapse:collapse;font-size:13px;
  min-width:400px;
}
.tbl-grid thead th{
  background:#eef1f6;
  padding:9px 13px;
  text-align:left;
  font-size:12px;font-weight:700;
  color:var(--text2);
  border:1px solid var(--border2);
  white-space:nowrap;
}
.tbl-grid tbody td{
  padding:8px 13px;
  border:1px solid var(--border2);
  color:var(--text);
  vertical-align:top;
  line-height:1.45;
}
.tbl-grid tbody tr:hover td{background:#eef4ff}
.tbl-grid tbody tr.tbl-alt td{background:#f9fafb}
.tbl-grid tbody tr.tbl-alt:hover td{background:#eef4ff}

.tbl-markdown{
  font-size:12px;line-height:1.6;padding:14px 16px;
  background:var(--surface2);color:var(--mono);
  font-family:'Courier New',monospace;overflow-x:auto;
  white-space:pre;
}
table{border-collapse:collapse;width:100%;font-size:12.5px}
th,td{border:1px solid var(--border);padding:7px 10px;text-align:left}
th{background:var(--surface2);font-weight:600;font-size:11.5px;color:var(--text2)}
td{color:var(--muted)}

/* ── Footer ── */
.footer{text-align:center;font-size:11px;color:var(--subtle);padding-top:12px}

/* ── Toast ── */
.toast{
  position:fixed;bottom:20px;right:20px;z-index:3000;
  padding:10px 15px;border-radius:var(--radius);
  font-size:12.5px;line-height:1.45;max-width:320px;
  background:#0f172a;color:#f1f5f9;
  box-shadow:var(--shadow-lg);border:1px solid rgba(255,255,255,.08);
}

.hidden{display:none!important}
.empty-msg{color:var(--muted);font-size:13px;padding:4px 0}

/* ── History table ── */
.hist-table{width:100%;border-collapse:collapse;font-size:12.5px}
.hist-table thead th{
  background:var(--surface2);
  padding:9px 11px;text-align:left;
  font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;
  color:var(--muted);border-bottom:1px solid var(--border);
  white-space:nowrap;position:sticky;top:0;
}
.hist-table tbody td{
  padding:9px 11px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
  max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--text2);
}
.hist-table tbody tr:last-child td{border-bottom:none}
.hist-table tbody tr:hover td{background:var(--surface2)}

.status-done      {color:var(--success);font-weight:600}
.status-error     {color:var(--danger);font-weight:600}
.status-processing{color:var(--warning);font-weight:600}
.status-queued    {color:var(--subtle)}

.bulk-bar{
  display:flex;align-items:center;gap:8px;
  padding:8px 12px;margin-top:10px;
  background:#fffbeb;border:1px solid #fde68a;border-radius:var(--radius-sm);
  font-size:12.5px;
}
.bulk-bar span{flex:1;color:var(--text);font-weight:500}

.del-job-btn{
  background:none;border:none;cursor:pointer;
  font-size:14px;padding:3px 5px;border-radius:4px;
  opacity:.4;transition:opacity .12s,background .12s;
}
.del-job-btn:hover{opacity:1;background:var(--danger-bg)}
.del-job-btn:disabled{opacity:.2;cursor:not-allowed}

/* ─────────────────────────────────────────────
   ORDER, CLIENTS & PRODUCT MASTER VIEWS
───────────────────────────────────────────── */
#viewOrder, #viewTodayOrder, #viewClients, #viewProductMaster{display:flex;flex-direction:column;height:100%}

.client-kw-tag{
  display:inline-block;
  background:var(--surface2);
  border:1px solid var(--border);
  padding:1px 6px;
  border-radius:4px;
  font-size:11px;
  color:var(--text2);
  margin:2px 3px 2px 0;
}

.prod-code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;font-weight:600;color:var(--accent);
}
.prod-price{
  font-variant-numeric:tabular-nums;
  font-weight:600;color:var(--text);text-align:right;
}
.prod-actions{
  display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;
}
.prod-btn{
  background:none;border:1px solid var(--border);border-radius:var(--radius-sm);
  cursor:pointer;padding:4px 9px;font-size:11px;font-weight:500;color:var(--text2);
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  white-space:nowrap;flex-shrink:0;line-height:1.2;
  transition:all .12s;
}
.prod-btn:hover{background:var(--surface2);border-color:var(--accent);color:var(--accent)}
.prod-btn-headings:hover{background:#eff6ff;border-color:#3b82f6;color:#2563eb}
.prod-btn-del:hover{background:var(--danger-bg);border-color:var(--danger);color:var(--danger)}

.client-row-badge{
  display:inline-block;
  background:#f1f5f9;
  border:1px solid #cbd5e1;
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  color:#334155;
  padding:1px 6px;
  margin-right:6px;
  white-space:nowrap;
}
.client-cols-preview{
  display:inline-flex;
  flex-wrap:wrap;
  gap:2px;
  align-items:center;
  max-width:320px;
}

.order-topbar{
  display:flex;align-items:center;gap:10px;
  padding:12px 20px 11px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  box-shadow:var(--shadow-sm);
}
.order-topbar-title{
  display:flex;align-items:center;gap:9px;
  font-size:15px;font-weight:700;color:var(--text);
  letter-spacing:-.01em;
}
.order-topbar-title svg{color:var(--accent)}
.order-row-count{
  font-size:12px;color:var(--muted);
  background:var(--surface2);border:1px solid var(--border);
  padding:2px 9px;border-radius:12px;font-weight:500;
  flex:1;
}
.order-toolbar-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.btn-add-client{
  font-size:11px;padding:4px 11px;
  color:var(--accent);border-color:var(--accent-bd);background:var(--accent-bg);
  border-radius:var(--radius-sm);font-weight:600;
}
.btn-add-client:hover{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ── Filter bar ── */
.order-filterbar{
  display:flex;align-items:center;gap:8px;
  padding:10px 16px;
  background:var(--surface);
  border-bottom:2px solid var(--border);
  flex-shrink:0;
  flex-wrap:wrap;
}
.filter-search-wrap{
  position:relative;display:flex;align-items:center;flex:1;min-width:160px;
}
.filter-search-icon{
  position:absolute;left:9px;color:var(--muted);pointer-events:none;
}
.filter-search{
  width:100%;padding:7px 10px 7px 30px;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;background:var(--surface2);color:var(--text);
  outline:none;font-family:inherit;
  transition:border-color .15s,box-shadow .15s;
}
.filter-search:focus{border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.filter-select{
  padding:7px 10px;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;background:var(--surface2);color:var(--text);
  outline:none;font-family:inherit;cursor:pointer;
  transition:border-color .15s;
}
.filter-select:focus{border-color:var(--accent)}

/* ── Excel-style sheet ── */
.order-sheet-wrap{
  flex:1;overflow:auto;
  -webkit-overflow-scrolling:touch;
  background:var(--bg);
}
.order-sheet{
  width:100%;border-collapse:collapse;
  font-size:13px;
  min-width:900px;
  border:1px solid var(--border2);
}
.order-sheet thead th{
  background:#132e56;
  padding:10px 14px;
  text-align:left;
  font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
  color:#ffffff;
  border:1px solid #23477a;
  white-space:nowrap;
  position:sticky;top:0;z-index:5;
}
.order-sheet thead th.sortable{cursor:pointer;user-select:none}
.order-sheet thead th.sortable:hover{background:#1b3e73;color:#ffffff}
.sort-icon{font-size:10px;opacity:.85;margin-left:3px;color:#93c5fd}

.order-sheet tbody tr{transition:background .08s}
.order-sheet tbody tr:hover td{background:#eef4ff;cursor:pointer}
.order-sheet tbody tr.row-alt td{background:#f9fafb}
.order-sheet tbody tr.row-alt:hover td{background:#eef4ff}
.order-sheet tbody tr.row-selected td{background:#eff6ff}
.order-sheet tbody tr.row-selected:hover td{background:#dbeafe}
.order-sheet tbody td{
  padding:9px 14px;
  border:1px solid var(--border2);
  vertical-align:middle;
  color:var(--text2);
}

/* column widths */
.order-sheet .col-check{width:42px;min-width:42px;text-align:center;padding-left:8px;padding-right:8px}
.order-sheet .col-check input[type="checkbox"]{cursor:pointer;width:14px;height:14px;accent-color:var(--accent);vertical-align:middle}
.col-no{width:46px;text-align:center;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.col-client{min-width:130px}
.col-file{min-width:200px;max-width:300px}
.col-engine{width:110px;white-space:nowrap}
.col-status{width:100px;white-space:nowrap}
.col-conf{width:120px;white-space:nowrap}
.col-time{width:80px;white-space:nowrap;text-align:right;color:var(--muted)}
.col-date{width:130px;white-space:nowrap;color:var(--muted);font-size:12px}
.col-preview{width:86px;min-width:86px;text-align:center;white-space:nowrap}

.order-row-actions{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
}
.col-file{
  font-weight:500;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px;
}
.sheet-client{display:block;font-weight:600;font-size:13px;color:var(--text)}
.sheet-client-en{display:block;font-size:11px;color:var(--muted)}
.sheet-unassigned{color:var(--subtle);font-style:italic}

.preview-btn{
  background:none;border:1px solid var(--border);border-radius:var(--radius-sm);
  cursor:pointer;padding:3px 7px;font-size:11px;color:var(--muted);
  transition:all .12s;
}
.preview-btn:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.order-del-btn{
  background:none;border:1px solid var(--border);border-radius:var(--radius-sm);
  cursor:pointer;padding:3px 7px;font-size:11px;color:var(--muted);
  transition:all .12s;
}
.order-del-btn:hover:not(:disabled){background:#fef2f2;border-color:#fca5a5;color:#dc2626}
.order-del-btn:disabled{opacity:.45;cursor:not-allowed}

.sheet-loading,.sheet-empty{
  color:var(--muted);font-size:13px;padding:60px 24px;
  text-align:center;
}

/* status badges in table */
.badge{
  display:inline-flex;align-items:center;gap:4px;
  padding:2px 8px;border-radius:12px;font-size:11px;font-weight:600;
}
.badge-done{background:var(--success-bg);color:var(--success)}
.badge-error{background:var(--danger-bg);color:var(--danger)}
.badge-processing{background:var(--warning-bg);color:var(--warning)}
.badge-queued{background:var(--surface2);color:var(--muted)}
.badge-engine{background:var(--accent-bg);color:var(--accent)}
.badge-dot{width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0}

.conf-cell{display:flex;align-items:center;gap:7px;justify-content:flex-end}
.conf-bar-wrap{width:44px;height:4px;background:var(--border);border-radius:2px;overflow:hidden;flex-shrink:0}
.conf-bar{height:100%;border-radius:2px;background:var(--success)}
.conf-warn .conf-bar{background:var(--warning)}
.conf-low .conf-bar{background:var(--danger)}

/* ── Empty / loading states ── */
.order-empty,.order-loading{
  color:var(--muted);font-size:13px;
  padding:60px 20px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.order-empty svg,.order-loading svg{opacity:.3}
.order-empty small{display:block;margin-top:4px;font-size:12px;color:var(--subtle)}

/* ── Result preview drawer ── */
.order-preview{
  position:fixed;bottom:0;left:220px;right:0;
  max-height:45vh;background:var(--surface);
  border-top:2px solid var(--accent);
  display:flex;flex-direction:column;
  box-shadow:0 -6px 24px rgba(0,0,0,.12);
  z-index:30;
}
.order-preview-header{
  display:flex;align-items:center;gap:10px;
  padding:11px 18px;border-bottom:1px solid var(--border);
  font-size:13px;font-weight:600;color:var(--text);flex-shrink:0;
}
.order-preview-header span{flex:1}
.order-preview-body{
  flex:1;overflow:auto;border-radius:0;border:none;
  margin:0;max-height:none;font-size:12px;
}

/* ── Client modal ── */
.modal-backdrop{
  position:fixed;inset:0;z-index:1000;
  background:rgba(15,17,23,.55);
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(2px);
}
.modal-backdrop.hidden{display:none}
#clientHeadingModalBackdrop{z-index:2500}
.modal-box{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  width:440px;max-width:95vw;
  max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);
  overflow-y:auto;
  padding:28px;
  display:flex;flex-direction:column;gap:20px;
  box-shadow:var(--shadow-lg);
}
.modal-title{font-size:16px;font-weight:700;color:var(--text);letter-spacing:-.01em}
.modal-body{display:flex;flex-direction:column;gap:14px;min-height:0}
.modal-field{display:flex;flex-direction:column;gap:5px}
.modal-label{
  font-size:12px;font-weight:600;color:var(--text2);
}
.modal-label small{font-weight:400;color:var(--muted)}
.required{color:var(--danger)}
.modal-input{
  width:100%;padding:8px 11px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);font-size:13px;
  background:var(--surface);color:var(--text);
  outline:none;transition:border-color .15s,box-shadow .15s;
  font-family:inherit;
}
.modal-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.modal-footer{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--border);padding-top:16px;margin-top:-4px}
.modal-save-btn{padding:8px 22px;font-size:13px;font-weight:600}

/* ── Excel Preview Modal ── */
.xls-overlay{
  position:fixed;inset:0;z-index:2000;
  background:rgba(0,0,0,.55);
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(3px);
}
.xls-overlay.hidden{display:none}
.xls-window{
  width:94vw;height:90vh;max-width:1440px;
  background:#fff;border-radius:4px;
  box-shadow:0 24px 64px rgba(0,0,0,.45);
  display:flex;flex-direction:column;overflow:hidden;
}
/* titlebar */
.xls-titlebar{
  background:#217346;color:#fff;
  display:flex;align-items:center;
  padding:0 8px 0 12px;height:36px;flex-shrink:0;
}
.xls-titlebar-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}
.xls-title-text{
  font-size:13px;font-weight:500;letter-spacing:.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.xls-win-btn{
  background:transparent;border:none;color:rgba(255,255,255,.85);
  width:32px;height:32px;border-radius:2px;cursor:pointer;
  font-size:14px;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.xls-win-btn:hover{background:#c41e3a;color:#fff}
/* formula bar */
.xls-formulabar{
  display:flex;align-items:center;gap:6px;
  border-bottom:1px solid #d0d0d0;background:#fff;
  padding:4px 10px;flex-shrink:0;min-height:36px;
  flex-wrap:nowrap;overflow-x:auto;
}
.xls-cell-ref{
  min-width:68px;max-width:68px;text-align:center;
  font-size:12px;font-family:'Calibri','Arial',sans-serif;
  border:1px solid #bbb;border-radius:2px;padding:2px 6px;
  color:#000;flex-shrink:0;
}
.xls-formulabar-sep{
  margin:0 6px;color:#888;font-size:12px;
  font-style:italic;flex-shrink:0;
}
.xls-cell-val{
  flex:1;font-size:12px;
  font-family:'Calibri','Consolas',monospace;
  color:#000;min-width:140px;padding:3px 6px;
  border:1px solid #d0d0d0;border-radius:3px;
  background:#fff;outline:none;
  transition:border-color .15s,box-shadow .15s;
}
.xls-cell-val:focus{
  border-color:#1a73e8;
  box-shadow:0 0 0 2px rgba(26,115,232,.15);
}
.xls-header-tools{
  display:flex;align-items:center;gap:6px;flex-shrink:0;
  margin-left:8px;margin-right:8px;
  padding-left:10px;border-left:1px solid #e0e0e0;
}
.xls-header-lbl{
  font-size:11px;font-weight:700;color:#475569;
  font-family:'Calibri','Arial',sans-serif;white-space:nowrap;
}
.xls-header-select{
  font-size:11px;padding:3px 6px;border:1px solid #cbd5e1;border-radius:3px;
  background:#f8fafc;color:#0f172a;max-width:240px;outline:none;
  font-family:'Calibri','Arial',sans-serif;cursor:pointer;
  font-weight:500;
}
.xls-header-select:focus{border-color:#217346;background:#fff}
.btn-header-act{
  background:#f0fdf4;border:1px solid #86efac;color:#166534;font-weight:600;
  padding:3px 8px;font-size:11px;border-radius:3px;cursor:pointer;
  transition:all .12s;white-space:nowrap;
}
.btn-header-act:hover{background:#dcfce7;border-color:#4ade80;color:#15803d}
/* Client Heading Format Bar inside Excel Modal */
.xls-client-bar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:6px 12px;background:#f8fafc;border-bottom:1px solid #cbd5e1;
  flex-shrink:0;flex-wrap:wrap;
}
.xls-client-bar-left{
  display:flex;align-items:center;gap:6px;flex-shrink:0;white-space:nowrap;
}
.xls-client-bar-label{
  font-size:11px;font-weight:700;color:#334155;text-transform:uppercase;letter-spacing:.03em;
}
.xls-client-select{
  padding:3px 8px;border:1px solid #cbd5e1;border-radius:5px;
  font-size:12px;font-weight:600;color:#1e293b;background:#fff;
  outline:none;cursor:pointer;font-family:inherit;max-width:220px;
}
.xls-client-select:focus{border-color:#2563eb}
.xls-date-label{margin-left:4px}
.xls-date-input{
  padding:2px 7px;border:1px solid #cbd5e1;border-radius:5px;
  font-size:12px;font-weight:600;color:#1e293b;background:#fff;
  outline:none;cursor:pointer;font-family:inherit;height:25px;
  line-height:1.2;
}
.xls-date-input:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.xls-client-bar-cols{
  flex:1;min-width:200px;display:flex;align-items:center;gap:4px;
  overflow-x:auto;padding:2px 0;scrollbar-width:thin;
}
.xls-client-bar-actions{
  display:flex;align-items:center;gap:6px;flex-shrink:0;white-space:nowrap;
}
.xls-client-btn{padding:3px 8px;font-size:11px}
.xls-client-btn.active{
  background:#eff6ff;border-color:#2563eb;color:#1d4ed8;font-weight:600;
}
/* main grid */
.xls-main{flex:1;overflow:hidden;position:relative;background:#f0f0f0}
.xls-loading{
  display:flex;align-items:center;justify-content:center;
  height:100%;font-size:14px;color:#888;
}
.xls-grid-wrap{height:100%;overflow:auto;background:#fff}
.xls-grid-wrap.hidden{display:none}
/* spreadsheet table */
.xls-table{border-collapse:collapse;min-width:100%;background:#fff}
.xls-th-corner{
  position:sticky;top:0;left:0;z-index:4;
  width:52px;min-width:52px;
  background:#e8e8e8;border:1px solid #c0c0c0;
  border-top:none;border-left:none;
}
.xls-th-col{
  position:sticky;top:0;z-index:3;
  background:#e8e8e8;border:1px solid #c0c0c0;border-top:none;
  text-align:center;font-size:11px;font-weight:600;color:#333;
  padding:4px 8px;min-width:96px;user-select:none;
  font-family:'Calibri','Arial',sans-serif;white-space:nowrap;
  box-sizing:border-box;
}
.xls-th-col.has-heading,
.xls-th-col.in-header-span{
  background:#132e56 !important;
  border:1px solid #23477a !important;
  border-bottom:2px solid #0b1c36 !important;
  padding:4px 8px !important;
  color:#ffffff !important;
}
.xls-th-letter{
  font-size:10px;color:#64748b;font-weight:700;line-height:1.2;
}
.xls-th-col.has-heading .xls-th-letter,
.xls-th-col.in-header-span .xls-th-letter{
  color:#93c5fd !important;font-size:9px;opacity:.9;
}
.xls-th-title{
  font-size:12px;color:#0f172a;font-weight:700;
  max-width:260px;overflow:hidden;text-overflow:ellipsis;
  margin-top:2px;letter-spacing:0.01em;line-height:1.25;
}
.xls-th-col.has-heading .xls-th-title,
.xls-th-col.in-header-span .xls-th-title{
  color:#ffffff !important;
}
.hdr-main{
  font-size:12px;font-weight:700;color:#ffffff;line-height:1.25;white-space:nowrap;
}
.hdr-sub{
  font-size:10px;font-weight:500;color:#bfdbfe;line-height:1.15;margin-top:2px;white-space:nowrap;
}
.hdr-day{
  font-size:10px;font-weight:700;color:#e0f2fe;line-height:1.15;margin-top:1px;white-space:nowrap;
}
.hdr-extra{
  font-size:9px;font-weight:500;color:#93c5fd;line-height:1.15;margin-top:1px;letter-spacing:0.02em;white-space:nowrap;
}
.xls-th-col.has-heading:hover,
.xls-th-col.in-header-span:hover{background:#1b3e73 !important}
.xls-th-col.xls-col-sel{background:#bdd7ee;border-color:#2d6ea6}
.xls-td-row{
  position:sticky;left:0;z-index:2;
  background:#e8e8e8;border:1px solid #c0c0c0;border-left:none;
  text-align:center;font-size:11px;font-weight:600;color:#333;
  padding:2px 6px;min-width:52px;user-select:none;
  font-family:'Calibri','Arial',sans-serif;
  cursor:pointer;
  transition:background .1s;
}
.xls-td-row:hover{background:#dbeafe;color:#1e40af}
.xls-td-row.is-header-row{
  background:#0b1c36 !important;border-color:#1e3a63 !important;color:#93c5fd !important;font-weight:700;
}
.xls-td-row.xls-row-sel{background:#bdd7ee;border-color:#2d6ea6}
.xls-cell{
  border:1px solid #d0d0d0;padding:3px 8px;
  font-size:12px;font-family:'Calibri','Arial',sans-serif;
  color:#000;min-width:96px;max-width:320px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  cursor:cell;vertical-align:middle;background:#fff;
}
.xls-row-is-header .xls-cell{
  background:#132e56 !important;font-weight:700 !important;
  border-color:#23477a !important;color:#ffffff !important;
  text-align:center;padding:5px 8px !important;line-height:1.25;
}
.xls-cell.xls-hdr{
  background:#132e56 !important;font-weight:700 !important;
  border-color:#23477a !important;color:#ffffff !important;
  text-align:center;padding:5px 8px !important;line-height:1.25;
}
.xls-row-is-header:hover .xls-cell,
.xls-cell.xls-hdr:hover{
  background:#1b3e73 !important;
}
.xls-row-alt .xls-cell{background:#f8fafc}
.xls-row-alt.xls-row-is-header .xls-cell{background:#132e56 !important}
.xls-cell.xls-sel{
  background:#cce0ff !important;
  outline:2px solid #1a73e8;outline-offset:-2px;
  position:relative;z-index:1;
}
.xls-grid-wrap:focus{outline:none}
.xls-cell.xls-editing{
  padding:0 !important;background:#fff !important;color:#000 !important;
  outline:2px solid #1a73e8;outline-offset:-2px;
  position:relative;z-index:2;
}
.xls-cell-input{
  width:100%;height:100%;min-height:22px;
  border:none;outline:none;padding:3px 8px;
  font-size:12px;font-family:'Calibri','Arial',sans-serif;
  color:#000;background:#fff;box-sizing:border-box;
}
.xls-th-input{
  width:100%;min-width:72px;
  border:1px solid #1a73e8;border-radius:2px;outline:none;
  padding:1px 4px;font-size:11px;font-weight:700;text-align:center;
  font-family:'Calibri','Arial',sans-serif;
  color:#0f172a;background:#fff;box-sizing:border-box;margin-top:2px;
}
.btn-save-xls{
  background:#eff6ff;border:1px solid #93c5fd;color:#1d4ed8;font-weight:600;
}
.btn-save-xls:hover:not(:disabled){
  background:#dbeafe;border-color:#60a5fa;
}
.btn-save-xls.is-dirty{
  background:#2563eb;border-color:#1d4ed8;color:#fff;
}
.btn-save-xls.is-dirty:hover:not(:disabled){
  background:#1d4ed8;
}
.btn-del-rc{
  color:#b91c1c;border-color:#fecaca;background:#fff5f5;
}
.btn-del-rc:hover:not(:disabled){
  background:#fee2e2;border-color:#fca5a5;color:#991b1b;
}
/* sheet tabs bar */
.xls-sheetbar{
  display:flex;align-items:center;
  background:#e0e0e0;border-top:1px solid #c0c0c0;
  height:28px;flex-shrink:0;padding:0 8px;gap:2px;
}
.xls-sheet-tabs{display:flex;align-items:flex-end;gap:1px;height:100%;flex:1;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.xls-sheet-tabs::-webkit-scrollbar{display:none}
.xls-sheet-tab{
  padding:2px 14px 0;background:#c8c8c8;
  border:1px solid #aaa;border-bottom:none;
  border-radius:3px 3px 0 0;cursor:pointer;
  font-size:11px;color:#444;height:24px;
  display:flex;align-items:center;user-select:none;
  white-space:nowrap;transition:background .1s;
}
.xls-sheet-tab:hover{background:#d8d8d8}
.xls-sheet-tab.active{background:#fff;color:#000;font-weight:600;border-color:#c0c0c0}
.xls-sheetbar-status{font-size:11px;color:#555;white-space:nowrap;flex-shrink:0}

/* ── Live Heading Preview Bar (Document View Style) ── */
.heading-live-preview-wrap {
  border: 1px solid #c5d3e8;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #c5d3e8 #f0f4fa;
}
.heading-live-preview-wrap::-webkit-scrollbar { height: 5px }
.heading-live-preview-wrap::-webkit-scrollbar-track { background: #f0f4fa }
.heading-live-preview-wrap::-webkit-scrollbar-thumb { background: #c5d3e8; border-radius: 3px }
.heading-live-preview-bar { display: block; }

/* Document-view style table header in preview */
.heading-doc-table {
  border-collapse: collapse;
  width: 100%;
  min-width: max-content;
  font-family: 'Noto Sans JP','Hiragino Kaku Gothic ProN','Meiryo',sans-serif;
}
.heading-doc-th {
  background: #1e3a5f;
  color: #fff;
  padding: 7px 12px;
  border: 1px solid #163152;
  text-align: center;
  white-space: nowrap;
  min-width: 72px;
  vertical-align: middle;
}
.heading-doc-th-num {
  font-size: 9px;
  font-weight: 700;
  opacity: .55;
  margin-bottom: 3px;
  letter-spacing: .05em;
}
.heading-doc-th-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.heading-live-preview-empty {
  padding: 20px 16px;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Client table heading format badge chips ── */
.client-col-chip {
  display: inline-block;
  background: #132e56;
  border: 1px solid #23477a;
  border-radius: 3px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.client-col-chip.more {
  background: #1e3a63;
  color: #93c5fd;
  border-color: #2e5999;
}

/* ── Product Master: Enterprise Client Heading Formats Panel ── */
.pm-headings-section{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:var(--shadow-sm);
  margin:12px 16px 16px;
  overflow:hidden;
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.pm-headings-body{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}
.pm-headings-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 14px;
  background:#f8fafc;
  border-bottom:1px solid var(--border);
  gap:10px;
  flex-wrap:wrap;
}
.pm-headings-title{
  font-size:12.5px;
  font-weight:700;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.pm-headings-count{
  font-size:11px;
  font-weight:600;
  color:#1d4ed8;
  background:#dbeafe;
  padding:1px 8px;
  border-radius:999px;
}
.pm-headings-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.pm-client-tabs{
  display:flex;
  align-items:center;
  gap:6px;
  padding:8px 14px;
  background:#fcfcfd;
  border-bottom:1px solid #eef2f6;
  overflow-x:auto;
  scrollbar-width:thin;
}
.pm-client-tab{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#ffffff;
  color:var(--text2);
  font-family:inherit;
  font-size:12px;
  font-weight:500;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
  transition:all .12s ease;
}
.pm-client-tab:hover{
  border-color:#93c5fd;
  background:#f8fafc;
  color:var(--text);
}
.pm-client-tab.active{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:600;
  box-shadow:0 0 0 1px rgba(37,99,235,0.14);
}
.pm-tab-badge{
  font-size:10px;
  font-weight:600;
  padding:1px 6px;
  border-radius:999px;
  background:#f1f5f9;
  color:#475569;
}
.pm-client-tab.active .pm-tab-badge{
  background:#dbeafe;
  color:#1d4ed8;
}
.pm-headings-body.hidden{
  display:none;
}

/* Numbered Spreadsheet Column Schema Pills */
.pm-cols-list{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
}
.pm-cols-list.nowrap{
  flex-wrap:nowrap;
}
.pm-row-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border-radius:5px;
  background:#eef2ff;
  border:1px solid #c7d2fe;
  color:#3730a3;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
  flex-shrink:0;
}
.pm-col-pill{
  display:inline-flex;
  align-items:center;
  border-radius:5px;
  border:1px solid #cbd5e1;
  background:#ffffff;
  color:#1e293b;
  font-size:11.5px;
  font-weight:500;
  line-height:1.1;
  overflow:hidden;
  white-space:nowrap;
  flex-shrink:0;
  box-shadow:0 1px 1px rgba(15,23,42,0.03);
}
.pm-col-idx{
  font-style:normal;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:10px;
  font-weight:700;
  color:#475569;
  background:#f1f5f9;
  border-right:1px solid #cbd5e1;
  padding:4px 6px;
}
.pm-col-lbl{
  padding:4px 8px;
}
.pm-col-more{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border-radius:5px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  color:#475569;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
  flex-shrink:0;
}

/* Focused Single-Client Schema Banner */
.pm-active-schema-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px 16px;
  padding:11px 14px;
  background:#ffffff;
}
.pm-active-schema-info{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:190px;
  flex-shrink:0;
}
.pm-active-schema-name{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:13px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
}
.pm-active-schema-sub{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11.5px;
  color:var(--muted);
  white-space:nowrap;
}
.pm-active-schema-cols{
  flex:1;
  min-width:240px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
}
.pm-active-schema-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
  white-space:nowrap;
}

/* All-Clients Enterprise Schema Matrix */
.pm-schema-matrix-wrap{
  flex:1;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  background:#ffffff;
}
.pm-schema-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.pm-schema-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fafc;
  color:#475569;
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  padding:7px 14px;
  border-top:none;
  border-left:none;
  border-right:none;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.pm-schema-table tbody tr{
  cursor:pointer;
  transition:background .1s;
}
.pm-schema-table tbody tr:hover td{
  background:#f8fafc;
}
.pm-schema-table tbody tr.active td{
  background:#eff6ff;
}
.pm-schema-table tbody td{
  padding:8px 14px;
  border-left:none;
  border-right:none;
  border-top:none;
  border-bottom:1px solid #f1f5f9;
  vertical-align:middle;
  color:var(--text2);
}
.pm-schema-table tbody tr:last-child td{
  border-bottom:none;
}
.pm-schema-client-cell{
  white-space:nowrap;
  width:240px;
}
.pm-schema-client-main{
  display:flex;
  align-items:center;
  gap:7px;
}
.pm-schema-client-ja{
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
}
.pm-schema-client-en{
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}
.pm-schema-row-cell{
  width:90px;
  white-space:nowrap;
  text-align:center;
}
.pm-schema-action-cell{
  width:120px;
  text-align:right;
  white-space:nowrap;
}

.pm-cell-heading-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:nowrap;
}
.pm-modal-heading-preview{
  margin-top:8px;
  padding:10px 12px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:11.5px;
}
.pm-modal-heading-preview.hidden{
  display:none;
}

/* ── Responsive Layout Across Devices ── */

/* Large Desktop Monitors (>= 1440px) */
@media(min-width:1440px){
  .page{max-width:960px}
}

/* Tablet & Compact Laptops (769px – 1024px) */
@media(max-width:1024px){
  .sidebar{width:64px}
  .sidebar-logo{flex-direction:column;gap:10px;padding:14px 8px;justify-content:center}
  .sidebar-brand-info,.sidebar-section-label,.nav-item span{display:none}
  .nav-item{justify-content:center;padding:10px}
  .order-preview{left:64px}

  /* Expanded overlay sidebar drawer when toggled on tablet */
  .app-shell.sidebar-expanded .sidebar{
    position:fixed;top:0;bottom:0;left:0;width:220px;z-index:950;
    box-shadow:4px 0 24px rgba(0,0,0,.35);
  }
  .app-shell.sidebar-expanded .sidebar-logo{flex-direction:row;padding:18px 14px 16px;justify-content:flex-start}
  .app-shell.sidebar-expanded .sidebar-brand-info,
  .app-shell.sidebar-expanded .sidebar-section-label{display:block}
  .app-shell.sidebar-expanded .nav-item{justify-content:flex-start;padding:9px 12px}
  .app-shell.sidebar-expanded .nav-item span{display:inline}

  .order-topbar{flex-wrap:wrap;padding:10px 16px;gap:8px}
  .order-filterbar{flex-wrap:wrap;padding:10px 14px}

  .xls-window{width:98vw;height:94vh;height:94dvh}
  .xls-formulabar{flex-wrap:wrap;padding:6px 10px;row-gap:6px}
  .xls-header-tools{
    order:10;width:100%;margin:2px 0 0;padding:6px 0 2px;
    border-left:none;border-top:1px solid #e2e8f0;
    overflow-x:auto;scrollbar-width:thin;flex-shrink:0;
  }
  .pm-schema-matrix-wrap{-webkit-overflow-scrolling:touch}
}

/* Mobile & Phablet (<= 768px) */
@media(max-width:768px){
  .app-shell{flex-direction:column;height:100vh;height:100dvh}

  /* Bottom Navigation Bar */
  .sidebar{
    position:fixed;bottom:0;left:0;right:0;z-index:900;
    width:100% !important;
    height:calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom:env(safe-area-inset-bottom, 0px);
    flex-direction:row;
    border-right:none;border-top:1px solid #1e293b;
    box-shadow:0 -4px 16px rgba(0,0,0,.22);
  }
  .sidebar-logo,.sidebar-section-label,.sidebar-toggle-btn{display:none !important}
  .sidebar-nav{
    flex-direction:row;width:100%;
    padding:4px 6px;gap:4px;
    justify-content:space-around;align-items:center;
  }
  .nav-item{
    flex-direction:column;justify-content:center;align-items:center;
    gap:3px;padding:6px 4px;flex:1;min-width:0;
    border-radius:6px;text-align:center;
  }
  .nav-item span{
    display:block !important;font-size:10px;line-height:1.15;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;
  }

  .main-area{
    width:100%;flex:1;
    padding-bottom:calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Home view */
  .page{max-width:100%;padding:0 12px 24px}
  .header{padding:10px 14px;flex-wrap:wrap;gap:8px}
  .header-engines{gap:4px}
  .engine-badge{font-size:10px;padding:2px 7px}
  .card{padding:16px;border-radius:10px;margin-bottom:12px}
  .drop-zone{padding:24px 12px}
  .upload-client-row{flex-direction:column;align-items:stretch;gap:6px}
  .upload-client-controls{width:100%}
  .upload-client-select{min-width:100%}
  .engine-row{flex-direction:column;align-items:stretch;gap:6px}
  .toggle-group{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}
  .toggle{text-align:center}
  .results-header{flex-direction:column;align-items:stretch;gap:10px}
  .results-actions{display:flex;flex-wrap:wrap;gap:6px;width:100%}
  .results-actions .btn-sm,.results-actions .dl-dropdown{flex:1 1 auto}
  .results-actions .dl-toggle{width:100%}
  .results-client-bar{flex-direction:column;align-items:stretch;gap:8px}
  .results-client-bar-left{width:100%}
  .results-client-bar-right{width:100%;justify-content:flex-end}
  .bulk-bar{flex-wrap:wrap}

  /* Order / Clients / Product Master views */
  #viewOrder,#viewTodayOrder,#viewClients,#viewProductMaster{height:auto;min-height:calc(100dvh - 64px)}
  .order-topbar{padding:10px 12px;gap:8px}
  .order-row-count{flex:0 0 auto;margin-left:auto}
  .order-toolbar-actions{width:100%;display:flex;flex-wrap:wrap;gap:6px}
  .order-toolbar-actions .btn-sm{flex:1 1 auto;text-align:center;justify-content:center}
  .order-filterbar{padding:8px 12px;gap:6px}
  .filter-search-wrap{min-width:100%;order:-1}
  .filter-select{flex:1 1 calc(50% - 4px);min-width:120px;font-size:12px;padding:6px 8px}

  .order-sheet thead th{padding:8px 10px;font-size:10.5px}
  .order-sheet tbody td{padding:7px 10px;font-size:12px}
  .order-preview{
    left:0 !important;
    bottom:calc(60px + env(safe-area-inset-bottom, 0px));
    max-height:50dvh;
  }

  /* Product Master schema panel */
  .pm-headings-section{margin:8px 10px}
  .pm-headings-header{padding:8px 12px}
  .pm-headings-title{font-size:12px;white-space:normal}
  .pm-active-schema-banner{flex-direction:column;align-items:stretch;gap:10px;padding:10px 12px}
  .pm-active-schema-cols{min-width:0;width:100%}
  .pm-active-schema-actions{width:100%;justify-content:flex-end}
  .pm-schema-matrix-wrap{max-height:none;flex:1}
  .pm-active-schema-sub{white-space:normal;flex-wrap:wrap}

  /* Fullscreen Excel Preview Modal */
  .xls-window{width:100vw;height:100vh;height:100dvh;max-width:100vw;border-radius:0}
  .xls-cell-val{min-width:100px}
  .xls-client-bar{padding:6px 10px;gap:6px}
  .xls-client-bar-left{width:100%;justify-content:space-between;flex-wrap:wrap;gap:6px}
  .xls-client-select{flex:1;max-width:none}
  .xls-client-bar-cols{width:100%;min-width:0;order:3}
  .xls-client-bar-actions{width:100%;display:flex;flex-wrap:wrap;gap:4px}
  .xls-client-bar-actions .xls-client-btn{flex:1 1 auto;text-align:center}
  .xls-sheetbar-status{display:none}

  /* Modals & Toasts */
  .modal-box,
  #clientHeadingModalBackdrop .modal-box{
    width:calc(100vw - 20px) !important;
    max-width:calc(100vw - 20px) !important;
    max-height:calc(100vh - 24px);
    max-height:calc(100dvh - 24px);
    padding:18px 16px;
    gap:14px;
  }
  .toast{
    left:12px;right:12px;max-width:none;
    bottom:calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

/* Compact Mobile Excel Toolbar (<= 640px) */
@media(max-width:640px){
  .xls-cell-val{flex:1 1 calc(100% - 95px)}
  .xls-header-tools{order:2;margin-top:2px}
  #xlsSaveBtn,#xlsCsvBtn,#xlsDeleteOrderBtn{
    order:3;margin-left:0 !important;flex:1 1 auto;text-align:center;
  }
}

/* Small Smartphones (<= 480px) */
@media(max-width:480px){
  .header-engines{display:none}
  .toggle-group .toggle:first-child{grid-column:span 2}
  .filter-select{flex:1 1 100%}
  .modal-row{flex-direction:column !important;gap:10px !important}
  .modal-row > .modal-field{width:100% !important}
  .modal-footer{flex-direction:column-reverse;gap:8px}
  .modal-footer button{width:100%;justify-content:center}
  .xls-cell-ref{min-width:50px;max-width:54px}
}

@media(max-width:380px){
  .toggle-group{grid-template-columns:1fr}
  .toggle-group .toggle:first-child{grid-column:span 1}
}

/* Landscape Mobile & Short Viewports (<= 520px height) */
@media(max-height:520px){
  .header{padding:8px 14px}
  .card{padding:14px;margin-bottom:10px}
  .modal-box,
  #clientHeadingModalBackdrop .modal-box{
    max-height:calc(100vh - 16px);
    max-height:calc(100dvh - 16px);
    padding:14px 16px;
  }
  .xls-window{height:100vh;height:100dvh;max-height:100dvh}
}

/* ── Document View ── */
.xls-formulabar.xls-formulabar-hidden,
.xls-client-bar.xls-client-bar-hidden{display:none!important}

.xls-sheet-tab-doc{font-weight:600;border-top:2px solid transparent}
.xls-sheet-tab-doc.active{border-top-color:#1e3a5f;color:#1e3a5f!important}

.xls-doc-wrap{
  flex:1;overflow:auto;
  background:#eef1f5;
  padding:24px 20px;
  display:flex;flex-direction:column;align-items:center;
}

.doc-view{
  width:100%;max-width:960px;
  background:#fff;
  border-radius:6px;
  box-shadow:0 2px 14px rgba(0,0,0,.12);
  overflow:hidden;
  font-family:'Noto Sans JP','Hiragino Kaku Gothic ProN','Meiryo',sans-serif;
}

.doc-header{
  padding:22px 28px 16px;
  border-bottom:3px solid #1e3a5f;
  background:#fff;
}

.doc-title{
  font-size:1.25rem;font-weight:700;
  color:#1e3a5f;letter-spacing:.03em;
  margin-bottom:8px;
}

.doc-client-name{
  font-size:.95rem;font-weight:600;
  color:#1e3a5f;opacity:.8;margin-bottom:6px;
}

.doc-meta{margin-top:8px;display:flex;flex-direction:column;gap:3px}

.doc-meta-row{display:flex;flex-wrap:wrap;gap:20px}

.doc-meta-item{
  font-size:.8rem;color:#374151;
  padding:1px 0;
}

.doc-table-wrap{overflow-x:auto;padding:0 28px 24px}

.doc-table{
  width:100%;border-collapse:collapse;
  margin-top:16px;font-size:.82rem;
}

.doc-th{
  background:#1e3a5f;color:#fff;
  font-weight:600;padding:8px 11px;
  text-align:left;border:1px solid #163152;
  white-space:nowrap;
}

.doc-td{
  padding:5px 11px;
  border:1px solid #d9dfe8;
  color:#1a1a2e;
  vertical-align:middle;
}

.doc-td-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}

.doc-row-alt td{background:#f7f9fc}

.doc-row-total td{
  background:#dbeafe;font-weight:700;
  color:#1e3a5f;border-top:2px solid #1e3a5f;
}

.doc-row-category td{
  background:#e8f0fb;font-weight:600;
  color:#1e3a5f;font-size:.79rem;
  letter-spacing:.02em;
}

.doc-notes{
  padding:12px 28px 20px;
  border-top:1px solid #dee2e6;
  background:#fafafa;
}

.doc-note{font-size:.77rem;color:#6b7280;line-height:1.65}

.doc-empty{
  display:flex;align-items:center;justify-content:center;
  height:200px;color:#9ca3af;font-size:.9rem;
}

.doc-fulltext{padding:20px 28px}
.doc-fulltext pre{font-size:.79rem;color:#374151;white-space:pre-wrap;word-break:break-word}

/* ── 風水プロジェクト 発注書 Template ── */
.doc-fusui-hanchu{font-family:'Hiragino Kaku Gothic Pro','Meiryo','Yu Gothic',sans-serif}
.fusui-hanchu-header{background:#1a2744;color:#fff;padding:20px 28px 16px}
.fusui-hanchu-title{font-size:1.7rem;font-weight:700;letter-spacing:.08em}
.fusui-hanchu-company{font-size:.95rem;margin-top:4px;opacity:.88}
.fusui-hanchu-info{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid #dee2e6}
.fusui-hanchu-info-left{padding:14px 16px 14px 28px;border-right:1px solid #dee2e6}
.fusui-hanchu-info-right{padding:14px 28px 14px 16px}
.fusui-hanchu-info-label{font-size:.72rem;font-weight:700;color:#1a2744;text-transform:uppercase;letter-spacing:.06em;margin-bottom:5px}
.fusui-hanchu-recipient{font-size:1.05rem;font-weight:600;color:#111;margin-top:2px}
.fusui-hanchu-addr-line{font-size:.82rem;color:#374151;line-height:1.6;margin-top:1px}
.fusui-hanchu-dates{display:flex;flex-wrap:wrap;gap:24px;padding:10px 28px;background:#f1f5fb;border-bottom:1px solid #dee2e6;font-size:.83rem}
.fusui-hanchu-date-item{display:flex;gap:6px;align-items:center}
.fusui-hanchu-date-label{font-weight:600;color:#1a2744;white-space:nowrap}
.fusui-hanchu-table-wrap{overflow-x:auto;padding:0 28px 24px}
.fusui-hanchu-table{width:100%;border-collapse:collapse;margin-top:16px;font-size:.82rem}
.fusui-hanchu-th{background:#1a2744;color:#fff;font-weight:600;padding:9px 11px;text-align:left;border:1px solid #142033;white-space:nowrap}
.fusui-hanchu-th-num{text-align:right}
.fusui-hanchu-td{padding:7px 11px;border:1px solid #dee2e6;vertical-align:top}
.fusui-hanchu-td-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.fusui-hanchu-row-alt .fusui-hanchu-td{background:#f7f9fc}
.fusui-hanchu-row-total .fusui-hanchu-td{background:#dbeafe;font-weight:700;color:#1a2744;border-top:2px solid #1a2744}
.fusui-hanchu-notes{padding:12px 28px 20px;border-top:1px solid #dee2e6;background:#fafafa}
.fusui-hanchu-note{font-size:.77rem;color:#6b7280;line-height:1.65}

/* ── Today Order (本日の発注書) Excel Sheet & CRUD ── */
#todayOrderTitleBadge{
  flex:0 0 auto;
  color:#1F3864;
  background:#eff6ff;
  border-color:#bfdbfe;
  font-weight:600;
}
.today-format-select{
  flex:0 0 auto;
  padding:4px 10px;
  font-size:12.5px;
  font-weight:600;
  color:#1F3864;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  border-radius:6px;
  max-width:290px;
}
#todayOrderItemCount{
  flex:0 0 auto;
  margin-right:auto;
  color:#166534;
  background:#f0fdf4;
  border-color:#86efac;
  font-weight:600;
}
.today-order-filterbar{
  gap:10px 14px;
  padding:8px 16px;
}
.today-inline-date-wrap{
  display:flex;
  align-items:center;
  gap:6px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:3px 8px;
  flex-shrink:0;
}
.today-preset-bar,
.today-modal-presets{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.today-preset-label{
  font-size:11px;
  font-weight:600;
  color:var(--muted);
  white-space:nowrap;
}
.today-preset-chip{
  padding:3px 9px;
  font-size:11.5px;
  font-weight:500;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#f8fafc;
  color:#1e293b;
  cursor:pointer;
  font-family:inherit;
  white-space:nowrap;
  transition:all .12s;
}
.today-preset-chip:hover{
  background:#eff6ff;
  border-color:#3b82f6;
  color:#1d4ed8;
}
.today-preset-chip-all{
  background:#eff6ff;
  border-color:#93c5fd;
  color:#1d4ed8;
  font-weight:600;
}
.today-preset-chip-all:hover{
  background:#2563eb;
  border-color:#1d4ed8;
  color:#ffffff;
}
.today-xls-main{
  flex:1;
  min-height:0;
}
.today-xls-wrap{
  background:#fff;
}
/* Today Order Spreadsheet Table (Responsive Excel Layout) */
.today-xls-table{
  table-layout:fixed;
  width:100%;
  min-width:1120px;
  border-collapse:collapse;
}
.today-xls-table col.today-col-rn{
  width:46px;
}
.today-xls-table col.today-col-a{
  width:320px;
}
.today-xls-table col.today-col-other{
  width:88px;
}
.today-xls-table col.today-col-act{
  width:96px;
}
.today-xls-table .today-th-col-a{
  width:320px;
  min-width:280px;
}
.today-xls-table .today-th-col-other{
  width:88px;
  min-width:80px;
}
.today-xls-table .today-th-col-act{
  width:96px;
  min-width:92px;
}

/* Sticky column headers & operations for seamless responsive scrolling */
.today-xls-table th.xls-th-corner{
  position:sticky;
  left:0;
  top:0;
  z-index:6;
  background:#e2e8f0;
}
.today-xls-table td.xls-td-row{
  position:sticky;
  left:0;
  z-index:2;
  background:#f8fafc;
  box-shadow:2px 0 4px -2px rgba(0,0,0,0.1);
}
.today-xls-table th.today-th-col-act{
  position:sticky;
  right:0;
  top:0;
  z-index:6;
  background:#e2e8f0;
  box-shadow:-2px 0 4px -2px rgba(0,0,0,0.12);
  text-align:center;
}
.today-xls-table td.today-xls-actions{
  position:sticky;
  right:0;
  z-index:3;
  background:#fff;
  border:1px solid #d0d0d0;
  padding:2px 4px;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
  box-shadow:-2px 0 4px -2px rgba(0,0,0,0.08);
}
.today-xls-table td.today-xls-actions.today-xls-actions-hdr{
  background:#1F3864 !important;
  border-color:#2c4a7e !important;
  color:#ffffff !important;
  font-size:12px;
  font-weight:700;
  z-index:4;
  box-shadow:-2px 0 4px -2px rgba(0,0,0,0.2);
}

.today-xls-table .xls-cell{
  max-width:none;
  font-family:'Arial','Hiragino Kaku Gothic ProN','Yu Gothic','Meiryo',sans-serif;
  height:28px;
  line-height:1.35;
  font-size:12.5px;
}
.today-xls-table .today-xls-title{
  font-size:20px;
  font-weight:700;
  color:#1F3864;
  height:36px;
  padding:4px 10px;
  vertical-align:middle;
  white-space:nowrap;
}
.today-xls-table .today-xls-meta{
  font-size:13px;
  font-weight:400;
  color:#334155;
  height:26px;
  padding:3px 10px;
  vertical-align:middle;
  white-space:nowrap;
}
.today-xls-table .today-xls-header{
  background:#1F3864 !important;
  color:#ffffff !important;
  font-size:13px;
  font-weight:700;
  height:44px;
  padding:4px 8px;
  white-space:pre-line;
  vertical-align:middle;
  border-color:#2c4a7e !important;
}
.today-xls-table .today-xls-header.xls-sel{
  background:#274a84 !important;
  color:#ffffff !important;
  outline:2px solid #60a5fa;
  outline-offset:-2px;
}
.today-xls-table .today-xls-header-left{
  text-align:left;
}
.today-xls-table .today-xls-header-right{
  text-align:right;
}
.today-xls-table .today-xls-header-center{
  text-align:center;
}
.today-xls-table .today-xls-merged{
  height:38px;
  font-size:14px;
  color:#000000;
  text-align:center;
  vertical-align:middle;
  border-bottom:1px solid #333333 !important;
}
.today-xls-table .today-xls-note{
  font-size:12.5px;
  color:#475569;
  height:24px;
  padding:3px 10px;
  vertical-align:middle;
}
.today-xls-table .today-xls-num{
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.today-xls-table .today-xls-item-name{
  font-weight:600;
  color:#0f172a;
}
.today-xls-table .today-xls-item-unit{
  text-align:right;
  color:#334155;
}
.today-xls-table .today-xls-category{
  background:#d9e1f2 !important;
  color:#1F3864 !important;
  font-weight:700;
  font-size:13.5px;
  height:28px;
  padding:4px 10px;
  vertical-align:middle;
}
.today-xls-table .today-xls-wed-off{
  background:#e2e5ea !important;
  color:#64748b;
}
/* Day column headers: white when active, gray when empty */
.today-xls-table td.today-day-col.today-xls-header{
  background:#ffffff !important;
  color:#1F3864 !important;
}
.today-xls-table td.today-day-col-empty.today-xls-header{
  background:#b0bed0 !important;
  color:#4a5568 !important;
}
.today-xls-table .today-xls-center{
  text-align:center;
}
.today-xls-table .today-xls-jan{
  text-align:center;
  font-variant-numeric:tabular-nums;
  font-size:12px;
  color:#334155;
}

/* ── Excel-Style Freeze Panes (Fixed Left Product Columns, Scrollable Dates Portion) ── */

/* Sticky Text for Spanned Rows (Title, Meta, Category, Note) */
.today-sticky-text {
  position: sticky;
  left: 54px;
  display: inline-block;
  white-space: nowrap;
  font-family: inherit;
  z-index: 3;
}

/* ── Chiba Format (8 cols): Freeze Col 0 (品目) & Col 1 (単位) ── */
.today-xls-table:not(.format-haibukiya) col.today-col-rn { width: 44px; }
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) col.today-col-a { width: 280px; }
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) col.today-col-1 { width: 76px; }

.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) th.today-th-col-a,
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) td.today-td-col-a {
  position: sticky;
  left: 44px;
  z-index: 4;
  background: #ffffff;
  width: 280px;
  min-width: 260px;
}
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) th.today-th-col-a {
  z-index: 14;
  background: #e2e8f0;
}
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) td.today-td-col-a.today-xls-header {
  z-index: 12 !important;
  background: #1F3864 !important;
  color: #ffffff !important;
}

.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) th.today-th-col-1,
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) td.today-td-col-1 {
  position: sticky;
  left: 324px;
  z-index: 4;
  background: #ffffff;
  width: 76px;
  min-width: 70px;
  border-right: 2px solid #2563eb !important;
  box-shadow: 4px 0 8px -2px rgba(0,0,0,0.18);
}
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) th.today-th-col-1 {
  z-index: 14;
  background: #e2e8f0;
}
.today-xls-table:not(.format-haibukiya):not(.format-props-japan):not(.format-national-azabu):not(.format-tsukiji):not(.format-fusui):not(.format-nanohana) td.today-td-col-1.today-xls-header {
  z-index: 12 !important;
  background: #1F3864 !important;
  color: #ffffff !important;
}

/* ── Fusui 6-Column Format (風水プロジェクト / ゆうき市場) ── */
.today-xls-table.format-fusui col.today-col-fusui-0 { width: 130px; }
.today-xls-table.format-fusui col.today-col-fusui-1 { width: 400px; }
.today-xls-table.format-fusui col.today-col-fusui-2 { width: 100px; }
.today-xls-table.format-fusui col.today-col-fusui-3 { width: 80px; }
.today-xls-table.format-fusui col.today-col-fusui-4 { width: 100px; }
.today-xls-table.format-fusui col.today-col-fusui-5 { width: 100px; }

.today-xls-table.format-fusui td.today-td-fusui-3,
.today-xls-table.format-fusui td.today-td-fusui-4,
.today-xls-table.format-fusui td.today-td-fusui-5 { text-align: right; }

/* ── Nanohana 6-Column Format (なのはな生活協同組合) ── */
.today-xls-table.format-nanohana col.today-col-nanohana-0 { width: 100px; }
.today-xls-table.format-nanohana col.today-col-nanohana-1 { width: 280px; }
.today-xls-table.format-nanohana col.today-col-nanohana-2 { width: 100px; }
.today-xls-table.format-nanohana col.today-col-nanohana-3 { width: 120px; }
.today-xls-table.format-nanohana col.today-col-nanohana-4 { width: 100px; }
.today-xls-table.format-nanohana col.today-col-nanohana-5 { width: 120px; }

.today-xls-table.format-nanohana td.today-td-nanohana-0 { text-align: center; }
.today-xls-table.format-nanohana td.today-td-nanohana-1 { text-align: left; }
.today-xls-table.format-nanohana td.today-td-nanohana-2 { text-align: center; }
.today-xls-table.format-nanohana td.today-td-nanohana-3,
.today-xls-table.format-nanohana td.today-td-nanohana-4,
.today-xls-table.format-nanohana td.today-td-nanohana-5 { text-align: right; }

.today-xls-table.format-nanohana tr.today-row-summary td:not(.xls-td-row):not(.today-xls-actions) {
  background: #D9E1F2 !important;
  font-weight: 700 !important;
  color: #1F3864 !important;
}

/* ── Haibukiya 20-Column Freeze Panes (Freeze Col 0~6: 品目〜JANコード) ── */
.today-xls-table.format-haibukiya {
  min-width: 1760px;
}

/* Row numbers (Col RN) */
.today-xls-table.format-haibukiya col.today-col-rn { width: 44px; }
.today-xls-table.format-haibukiya th.xls-th-corner {
  width: 44px;
  min-width: 44px;
  left: 0;
  z-index: 16;
}
.today-xls-table.format-haibukiya td.xls-td-row {
  width: 44px;
  min-width: 44px;
  left: 0;
  z-index: 6;
}

/* Col 0: 品目 (Item Name) - left: 44px */
.today-xls-table.format-haibukiya col.today-col-h-0 { width: 140px; }
.today-xls-table.format-haibukiya th.today-th-h-0,
.today-xls-table.format-haibukiya td.today-td-h-0 {
  position: sticky;
  left: 44px;
  z-index: 4;
  background: #ffffff;
  width: 140px;
  min-width: 130px;
}

/* Col 1: 産地 (Origin) - left: 184px (44 + 140) */
.today-xls-table.format-haibukiya col.today-col-h-1 { width: 110px; }
.today-xls-table.format-haibukiya th.today-th-h-1,
.today-xls-table.format-haibukiya td.today-td-h-1 {
  position: sticky;
  left: 184px;
  z-index: 4;
  background: #ffffff;
  width: 110px;
  min-width: 100px;
}

/* Col 2: 栽培区分 (Cultivation) - left: 294px (184 + 110) */
.today-xls-table.format-haibukiya col.today-col-h-2 { width: 76px; }
.today-xls-table.format-haibukiya th.today-th-h-2,
.today-xls-table.format-haibukiya td.today-td-h-2 {
  position: sticky;
  left: 294px;
  z-index: 4;
  background: #ffffff;
  width: 76px;
  min-width: 70px;
}

/* Col 3: 規格・入数 (Spec) - left: 370px (294 + 76) */
.today-xls-table.format-haibukiya col.today-col-h-3 { width: 86px; }
.today-xls-table.format-haibukiya th.today-th-h-3,
.today-xls-table.format-haibukiya td.today-td-h-3 {
  position: sticky;
  left: 370px;
  z-index: 4;
  background: #ffffff;
  width: 86px;
  min-width: 80px;
}

/* Col 4: 単価/p (Price/p) - left: 456px (370 + 86) */
.today-xls-table.format-haibukiya col.today-col-h-4 { width: 62px; }
.today-xls-table.format-haibukiya th.today-th-h-4,
.today-xls-table.format-haibukiya td.today-td-h-4 {
  position: sticky;
  left: 456px;
  z-index: 4;
  background: #ffffff;
  width: 62px;
  min-width: 58px;
}

/* Col 5: 単価/cs (Price/cs) - left: 518px (456 + 62) */
.today-xls-table.format-haibukiya col.today-col-h-5 { width: 66px; }
.today-xls-table.format-haibukiya th.today-th-h-5,
.today-xls-table.format-haibukiya td.today-td-h-5 {
  position: sticky;
  left: 518px;
  z-index: 4;
  background: #ffffff;
  width: 66px;
  min-width: 62px;
}

/* Col 6: JANコード (JAN Code) - left: 584px (518 + 66) -> Freeze Divider Boundary */
.today-xls-table.format-haibukiya col.today-col-h-6 { width: 110px; }
.today-xls-table.format-haibukiya th.today-th-h-6,
.today-xls-table.format-haibukiya td.today-td-h-6 {
  position: sticky;
  left: 584px;
  z-index: 4;
  background: #ffffff;
  width: 110px;
  min-width: 100px;
  border-right: 2px solid #2563eb !important;
  box-shadow: 4px 0 8px -2px rgba(0,0,0,0.18);
}

/* Scrollable Date Columns (Col 7 ~ 18) */
.today-xls-table.format-haibukiya col.today-col-h-day,
.today-xls-table.format-haibukiya .today-th-h-day { width: 66px; min-width: 60px; }
.today-xls-table.format-haibukiya col.today-col-h-chg,
.today-xls-table.format-haibukiya .today-th-h-chg { width: 56px; min-width: 50px; }

/* Scrollable Notes Column (Col 19) */
.today-xls-table.format-haibukiya col.today-col-h-19,
.today-xls-table.format-haibukiya .today-th-h-19 { width: 240px; min-width: 200px; }

/* Props Japan (10-column format with 1-week auto-generated dates: 品番, 品名, 単位, ロット, 月〜土) */
.today-xls-table.format-props-japan {
  width: 100%;
  min-width: 1080px;
}
.today-xls-table.format-props-japan col.today-col-rn { width: 44px; }
.today-xls-table.format-props-japan th.xls-th-corner { width: 44px; min-width: 44px; left: 0; z-index: 16; }
.today-xls-table.format-props-japan td.xls-td-row { width: 44px; min-width: 44px; left: 0; z-index: 6; }

/* Col 0: 品番 - left: 44px */
.today-xls-table.format-props-japan col.today-col-p-0 { width: 96px; }
.today-xls-table.format-props-japan th.today-th-p-0,
.today-xls-table.format-props-japan td.today-td-p-0 {
  position: sticky; left: 44px; z-index: 4; background: #ffffff; width: 96px; min-width: 96px;
}
.today-xls-table.format-props-japan th.today-th-p-0 { z-index: 14; background: #e2e8f0; }
.today-xls-table.format-props-japan td.today-td-p-0.today-xls-header { z-index: 12 !important; background: #1F3864 !important; color: #ffffff !important; }

/* Col 1: 品名 - left: 140px */
.today-xls-table.format-props-japan col.today-col-p-1 { width: 260px; }
.today-xls-table.format-props-japan th.today-th-p-1,
.today-xls-table.format-props-japan td.today-td-p-1 {
  position: sticky; left: 140px; z-index: 4; background: #ffffff; width: 260px; min-width: 260px;
}
.today-xls-table.format-props-japan th.today-th-p-1 { z-index: 14; background: #e2e8f0; }
.today-xls-table.format-props-japan td.today-td-p-1.today-xls-header { z-index: 12 !important; background: #1F3864 !important; color: #ffffff !important; }

/* Col 2: 単位 - left: 400px */
.today-xls-table.format-props-japan col.today-col-p-2 { width: 84px; }
.today-xls-table.format-props-japan th.today-th-p-2,
.today-xls-table.format-props-japan td.today-td-p-2 {
  position: sticky; left: 400px; z-index: 4; background: #ffffff; width: 84px; min-width: 84px;
}
.today-xls-table.format-props-japan th.today-th-p-2 { z-index: 14; background: #e2e8f0; }
.today-xls-table.format-props-japan td.today-td-p-2.today-xls-header { z-index: 12 !important; background: #1F3864 !important; color: #ffffff !important; }

/* Col 3: ロット - left: 484px -> Freeze Divider */
.today-xls-table.format-props-japan col.today-col-p-3 { width: 76px; }
.today-xls-table.format-props-japan th.today-th-p-3,
.today-xls-table.format-props-japan td.today-td-p-3 {
  position: sticky; left: 484px; z-index: 4; background: #ffffff; width: 76px; min-width: 76px;
  border-right: 2px solid #2563eb !important;
  box-shadow: 4px 0 8px -2px rgba(0,0,0,0.18);
}
.today-xls-table.format-props-japan th.today-th-p-3 { z-index: 14; background: #e2e8f0; }
.today-xls-table.format-props-japan td.today-td-p-3.today-xls-header { z-index: 12 !important; background: #1F3864 !important; color: #ffffff !important; }

/* Scrollable 1-Week Weekday Columns (Col 4 ~ 9) — expand evenly to fill full width */
.today-xls-table.format-props-japan col.today-col-p-day,
.today-xls-table.format-props-japan .today-th-p-day { width: auto; min-width: 80px; }
.today-xls-table.format-props-japan .today-xls-item-code {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #334155;
}

/* ============================================================ */
/* National Azabu (13-col: 品目, 産地, 規格・入数, 単価/p, 単価/cs, JANコード, 月〜土, 備考) */
/* ============================================================ */
.today-xls-table.format-national-azabu {
  min-width: 1210px;
}
.today-xls-table.format-national-azabu col.today-col-rn { width: 44px; }
.today-xls-table.format-national-azabu th.xls-th-corner { width: 44px; min-width: 44px; left: 0; z-index: 16; }
.today-xls-table.format-national-azabu td.xls-td-row { width: 44px; min-width: 44px; left: 0; z-index: 6; }

/* Col 0: 品目 - left: 44px */
.today-xls-table.format-national-azabu col.today-col-na-0 { width: 150px; }
.today-xls-table.format-national-azabu th.today-th-na-0,
.today-xls-table.format-national-azabu td.today-td-na-0 {
  position: sticky; left: 44px; z-index: 4; background: #ffffff; width: 150px; min-width: 140px;
}

/* Col 1: 産地 - left: 194px (44+150) */
.today-xls-table.format-national-azabu col.today-col-na-1 { width: 110px; }
.today-xls-table.format-national-azabu th.today-th-na-1,
.today-xls-table.format-national-azabu td.today-td-na-1 {
  position: sticky; left: 194px; z-index: 4; background: #ffffff; width: 110px; min-width: 100px;
}

/* Col 2: 規格・入数 - left: 304px (194+110) */
.today-xls-table.format-national-azabu col.today-col-na-2 { width: 86px; }
.today-xls-table.format-national-azabu th.today-th-na-2,
.today-xls-table.format-national-azabu td.today-td-na-2 {
  position: sticky; left: 304px; z-index: 4; background: #ffffff; width: 86px; min-width: 80px;
}

/* Col 3: 単価/p - left: 390px (304+86) */
.today-xls-table.format-national-azabu col.today-col-na-3 { width: 62px; }
.today-xls-table.format-national-azabu th.today-th-na-3,
.today-xls-table.format-national-azabu td.today-td-na-3 {
  position: sticky; left: 390px; z-index: 4; background: #ffffff; width: 62px; min-width: 58px;
}

/* Col 4: 単価/cs - left: 452px (390+62) */
.today-xls-table.format-national-azabu col.today-col-na-4 { width: 66px; }
.today-xls-table.format-national-azabu th.today-th-na-4,
.today-xls-table.format-national-azabu td.today-td-na-4 {
  position: sticky; left: 452px; z-index: 4; background: #ffffff; width: 66px; min-width: 62px;
}

/* Col 5: JANコード - left: 518px (452+66) → Freeze Divider */
.today-xls-table.format-national-azabu col.today-col-na-5 { width: 110px; }
.today-xls-table.format-national-azabu th.today-th-na-5,
.today-xls-table.format-national-azabu td.today-td-na-5 {
  position: sticky; left: 518px; z-index: 4; background: #ffffff; width: 110px; min-width: 100px;
  border-right: 2px solid #2563eb !important;
  box-shadow: 4px 0 8px -2px rgba(0,0,0,0.18);
}

/* Scrollable Date Columns (Col 6~11) */
.today-xls-table.format-national-azabu col.today-col-na-day,
.today-xls-table.format-national-azabu .today-th-na-day { width: 60px; min-width: 56px; }

/* Scrollable Notes Column (Col 12) */
.today-xls-table.format-national-azabu col.today-col-na-12,
.today-xls-table.format-national-azabu .today-th-na-12 { width: 220px; min-width: 180px; }

/* Header Row styling for sticky columns */
.today-xls-table.format-national-azabu th.today-th-na-0,
.today-xls-table.format-national-azabu th.today-th-na-1,
.today-xls-table.format-national-azabu th.today-th-na-2,
.today-xls-table.format-national-azabu th.today-th-na-3,
.today-xls-table.format-national-azabu th.today-th-na-4,
.today-xls-table.format-national-azabu th.today-th-na-5 {
  z-index: 14;
  background: #e2e8f0;
}
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-0,
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-1,
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-2,
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-3,
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-4,
.today-xls-table.format-national-azabu td.today-xls-header.today-td-na-5 {
  z-index: 12 !important;
  background: #1F3864 !important;
  color: #ffffff !important;
}

/* ============================================================ */
/* Tsukiji Farm (11-col: 区分, 産地, 品目, 単位, 月〜土, 備考) */
/* ============================================================ */
.today-xls-table.format-tsukiji {
  min-width: 1080px;
}
.today-xls-table.format-tsukiji col.today-col-rn { width: 44px; }
.today-xls-table.format-tsukiji th.xls-th-corner { width: 44px; min-width: 44px; left: 0; z-index: 16; }
.today-xls-table.format-tsukiji td.xls-td-row { width: 44px; min-width: 44px; left: 0; z-index: 6; }

/* Col 0: 区分 - left: 44px */
.today-xls-table.format-tsukiji col.today-col-t-0 { width: 66px; }
.today-xls-table.format-tsukiji th.today-th-t-0,
.today-xls-table.format-tsukiji td.today-td-t-0 {
  position: sticky; left: 44px; z-index: 4; background: #ffffff; width: 66px; min-width: 60px; text-align: center;
}

/* Col 1: 産地 - left: 110px (44+66) */
.today-xls-table.format-tsukiji col.today-col-t-1 { width: 66px; }
.today-xls-table.format-tsukiji th.today-th-t-1,
.today-xls-table.format-tsukiji td.today-td-t-1 {
  position: sticky; left: 110px; z-index: 4; background: #ffffff; width: 66px; min-width: 60px; text-align: center;
}

/* Col 2: 品目 - left: 176px (110+66) */
.today-xls-table.format-tsukiji col.today-col-t-2 { width: 240px; }
.today-xls-table.format-tsukiji th.today-th-t-2,
.today-xls-table.format-tsukiji td.today-td-t-2 {
  position: sticky; left: 176px; z-index: 4; background: #ffffff; width: 240px; min-width: 200px;
}

/* Col 3: 単位 - left: 416px (176+240) -> Freeze Divider Boundary */
.today-xls-table.format-tsukiji col.today-col-t-3 { width: 60px; }
.today-xls-table.format-tsukiji th.today-th-t-3,
.today-xls-table.format-tsukiji td.today-td-t-3 {
  position: sticky; left: 416px; z-index: 4; background: #ffffff; width: 60px; min-width: 56px; text-align: center;
  border-right: 2px solid #2563eb !important;
  box-shadow: 4px 0 8px -2px rgba(0,0,0,0.18);
}

/* Scrollable Date Columns (Col 4~9) */
.today-xls-table.format-tsukiji col.today-col-tsukiji-day,
.today-xls-table.format-tsukiji .today-th-tsukiji-day { width: 66px; min-width: 60px; text-align: center; }

/* Scrollable Notes Column (Col 10) */
.today-xls-table.format-tsukiji col.today-col-t-10,
.today-xls-table.format-tsukiji .today-th-t-10 { width: 180px; min-width: 140px; }

/* Header Row styling for Tsukiji sticky columns */
.today-xls-table.format-tsukiji th.today-th-t-0,
.today-xls-table.format-tsukiji th.today-th-t-1,
.today-xls-table.format-tsukiji th.today-th-t-2,
.today-xls-table.format-tsukiji th.today-th-t-3 {
  z-index: 14;
  background: #e2e8f0;
}
.today-xls-table.format-tsukiji td.today-xls-header.today-td-t-0,
.today-xls-table.format-tsukiji td.today-xls-header.today-td-t-1,
.today-xls-table.format-tsukiji td.today-xls-header.today-td-t-2,
.today-xls-table.format-tsukiji td.today-xls-header.today-td-t-3 {
  z-index: 12 !important;
  background: #1F3864 !important;
  color: #ffffff !important;
}

/* Hover and selection on Tsukiji sticky columns */
.today-xls-table.format-tsukiji tr.today-row-item:hover td.today-td-t-0:not(.today-xls-header),
.today-xls-table.format-tsukiji tr.today-row-item:hover td.today-td-t-1:not(.today-xls-header),
.today-xls-table.format-tsukiji tr.today-row-item:hover td.today-td-t-2:not(.today-xls-header),
.today-xls-table.format-tsukiji tr.today-row-item:hover td.today-td-t-3:not(.today-xls-header) {
  background: #f8fafc;
}
.today-xls-table.format-tsukiji tr.today-row-rare:hover td:not(.xls-td-row):not(.today-xls-actions) {
  background: #fef08a !important;
}
.today-xls-table.format-tsukiji tr.today-row-fuuka:hover td:not(.xls-td-row):not(.today-xls-actions) {
  background: #fed7aa !important;
}
.today-xls-table.format-tsukiji tr.today-row-summary:hover td:not(.xls-td-row):not(.today-xls-actions) {
  background: #c6d9f1 !important;
}

.today-xls-table.format-tsukiji td.today-td-t-0.xls-sel,
.today-xls-table.format-tsukiji td.today-td-t-1.xls-sel,
.today-xls-table.format-tsukiji td.today-td-t-2.xls-sel,
.today-xls-table.format-tsukiji td.today-td-t-3.xls-sel {
  background: #cce0ff !important;
  z-index: 7 !important;
}

/* Row Highlights & Cell Statuses */
.today-xls-table tr.today-row-rare td:not(.xls-td-row):not(.today-xls-actions) {
  background: #FEF9C3 !important;
}
.today-xls-table tr.today-row-fuuka td:not(.xls-td-row):not(.today-xls-actions) {
  background: #FFEDD5 !important;
}
.today-xls-table tr.today-row-summary td:not(.xls-td-row):not(.today-xls-actions) {
  background: #D9E1F2 !important;
  font-weight: 700;
  color: #1F3864;
}
.today-cell-paused {
  color: #DC2626 !important;
  font-weight: 700 !important;
  text-align: center !important;
}
.today-cell-logistics {
  color: #475569;
  text-align: center;
  font-size: 11.5px;
}

/* Action Column (Sticky Right) */
.today-xls-table th.today-th-col-act,
.today-xls-table td.today-xls-actions {
  border-left: 2px solid #2563eb !important;
  box-shadow: -4px 0 8px -2px rgba(0,0,0,0.15);
}

/* Header Row styling for all sticky columns */
.today-xls-table.format-haibukiya th.today-th-h-0,
.today-xls-table.format-haibukiya th.today-th-h-1,
.today-xls-table.format-haibukiya th.today-th-h-2,
.today-xls-table.format-haibukiya th.today-th-h-3,
.today-xls-table.format-haibukiya th.today-th-h-4,
.today-xls-table.format-haibukiya th.today-th-h-5,
.today-xls-table.format-haibukiya th.today-th-h-6 {
  z-index: 14;
  background: #e2e8f0;
}
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-0,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-1,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-2,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-3,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-4,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-5,
.today-xls-table.format-haibukiya td.today-xls-header.today-td-h-6 {
  z-index: 12 !important;
  background: #1F3864 !important;
  color: #ffffff !important;
}

/* Row Hover on Sticky Columns */
.today-xls-table tr.today-row-item:hover td.today-td-col-a,
.today-xls-table tr.today-row-item:hover td.today-td-col-1,
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-0:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-1:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-2:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-3:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-4:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-5:not(.today-xls-header),
.today-xls-table.format-haibukiya tr.today-row-item:hover td.today-td-h-6:not(.today-xls-header) {
  background: #f8fafc;
}

/* Selected Cell on Sticky Columns */
.today-xls-table td.today-td-col-a.xls-sel,
.today-xls-table td.today-td-col-1.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-0.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-1.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-2.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-3.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-4.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-5.xls-sel,
.today-xls-table.format-haibukiya td.today-td-h-6.xls-sel {
  background: #cce0ff !important;
  z-index: 7 !important;
}

/* Day header cells in Haibukiya: compact font, perfect centering, zero ellipsis */
.today-xls-table.format-haibukiya .today-xls-header.today-th-h-day{
  font-size:11.5px !important;
  font-weight:700;
  padding:3px 2px !important;
  line-height:1.22;
  text-align:center;
}
.today-xls-table.format-haibukiya .today-xls-header.today-th-h-chg{
  font-size:11px !important;
  font-weight:600;
  padding:3px 2px !important;
  line-height:1.22;
  text-align:center;
  background:#1a3057 !important;
  color:#bfdbfe !important;
}
.today-xls-table .today-xls-change{
  background:#f8fafc;
  color:#1e293b;
  font-size:12px;
  font-weight:500;
}
.today-xls-table .today-th-h-chg .xls-th-letter{
  color:#94a3b8;
  font-size:10px;
}
.today-modal-box-haibukiya{
  width:96vw;
  max-width:1440px;
  max-height:92vh;
  display:flex;
  flex-direction:column;
  padding:18px 22px;
}
.today-modal-box-haibukiya .today-modal-items-wrap{
  flex:1 1 auto;
  max-height:54vh;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #cbd5e1;
  border-radius:6px;
}
.today-modal-box-haibukiya .today-modal-items-table{
  min-width:1380px;
  table-layout:fixed;
}
.today-xls-table tr.today-row-item:hover td:not(.today-xls-header):not(.xls-td-row){
  background:#f8fafc;
}
.today-xls-table tr.today-row-match td:not(.xls-td-row){
  background:#fef9c3 !important;
}
.today-row-act-group{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.today-row-act-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  padding:0;
  background:#ffffff;
  border:1px solid #cbd5e1;
  border-radius:5px;
  cursor:pointer;
  color:#475569;
  transition:all .15s ease;
  box-shadow:0 1px 2px rgba(0,0,0,0.05);
}
.today-row-act-btn svg{
  pointer-events:none;
  display:block;
}
.today-row-act-btn:hover{
  background:#eff6ff;
  border-color:#3b82f6;
  color:#1d4ed8;
  transform:translateY(-1px);
  box-shadow:0 2px 5px rgba(59,130,246,0.2);
}
.today-row-act-btn.add{
  color:#059669;
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.today-row-act-btn.add:hover{
  background:#dcfce7;
  border-color:#22c55e;
  color:#15803d;
  box-shadow:0 2px 5px rgba(34,197,94,0.25);
}
.today-row-act-btn.edit{
  color:#2563eb;
  background:#eff6ff;
  border-color:#bfdbfe;
}
.today-row-act-btn.edit:hover{
  background:#dbeafe;
  border-color:#3b82f6;
  color:#1d4ed8;
  box-shadow:0 2px 5px rgba(59,130,246,0.25);
}
.today-row-act-btn.del{
  color:#dc2626;
  background:#fef2f2;
  border-color:#fecaca;
}
.today-row-act-btn.del:hover{
  background:#fee2e2;
  border-color:#ef4444;
  color:#b91c1c;
  box-shadow:0 2px 5px rgba(239,68,68,0.25);
}
.today-hdr-act-btn{
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.32);
  border-radius:4px;
  color:#ffffff;
  font-size:11px;
  font-weight:600;
  padding:3px 6px;
  cursor:pointer;
  font-family:inherit;
  line-height:1.25;
  transition:background .12s,border-color .12s;
}
.today-hdr-act-btn:hover{
  background:rgba(255,255,255,.26);
  border-color:#93c5fd;
}
.today-modal-box{
  width:620px;
  max-width:95vw;
}
.today-modal-box-wide{
  width:900px;
  max-width:96vw;
}
.today-modal-date-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px 14px;
  padding:9px 12px;
  background:#f1f5fb;
  border:1px solid #c7d6ed;
  border-radius:var(--radius-sm);
}
.today-modal-date-field{
  display:flex;
  align-items:center;
  gap:8px;
}
.today-modal-period-preview{
  font-size:12px;
  font-weight:600;
  color:#1F3864;
}
.today-modal-items-wrap{
  max-height:48vh;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:#fff;
}
.today-modal-items-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  min-width:740px;
}
.today-modal-items-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#1F3864;
  color:#fff;
  font-size:11px;
  font-weight:700;
  padding:7px 6px;
  text-align:center;
  border:1px solid #2c4a7e;
  white-space:nowrap;
}
.today-modal-items-table thead th:nth-child(2){
  text-align:left;
}
.today-modal-items-table tbody td{
  padding:5px 4px;
  border:1px solid #e2e8f0;
  vertical-align:middle;
  text-align:center;
}
.today-m-row-num{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  background:#f8fafc;
}
.today-m-input{
  width:100%;
  padding:5px 7px;
  border:1px solid #cbd5e1;
  border-radius:4px;
  font-size:12.5px;
  font-family:inherit;
  color:var(--text);
  background:#fff;
  outline:none;
}
.today-m-input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(37,99,235,.12);
}
.today-m-input.today-input-error{
  border-color:#dc2626 !important;
  background:#fef2f2 !important;
  color:#991b1b;
}
.today-m-input.today-input-error:focus{
  box-shadow:0 0 0 2px rgba(220,38,38,.18);
}
.today-m-input.today-input-valid{
  border-color:#16a34a;
}
.today-modal-val-msg{
  padding:8px 12px;
  border-radius:var(--radius-sm);
  background:#fef2f2;
  border:1px solid #fca5a5;
  color:#b91c1c;
  font-size:12px;
  font-weight:600;
  line-height:1.45;
}
.today-xls-table .xls-cell.today-cell-invalid{
  background:#fef2f2 !important;
  outline:1.5px dashed #dc2626;
  outline-offset:-2px;
  color:#b91c1c;
}
.today-m-day{
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.today-m-del{
  background:none;
  border:1px solid #e2e8f0;
  border-radius:4px;
  color:#64748b;
  cursor:pointer;
  padding:4px 7px;
  font-size:12px;
}
.today-m-del:hover{
  background:#fef2f2;
  border-color:#fca5a5;
  color:#dc2626;
}

.today-modal-table-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.today-modal-hint{
  font-size:11.5px;
  color:var(--muted);
}
.today-days-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.today-day-field{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.today-day-lbl{
  font-size:11px;
  font-weight:600;
  color:var(--text2);
  text-align:center;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:4px;
  padding:2px 6px;
}
.today-day-input{
  text-align:right;
  font-variant-numeric:tabular-nums;
}
/* Comprehensive Responsive Media Queries */
@media(max-width: 1440px){
  .order-topbar{
    padding:8px 14px;
    gap:8px 12px;
  }
  .today-order-filterbar{
    padding:6px 14px;
    gap:8px 12px;
  }
  .today-format-select{
    max-width:260px;
    font-size:12px;
    height:30px;
  }
  .order-toolbar-actions .btn-sm{
    padding:3px 7px;
    font-size:11.5px;
    height:28px;
  }
}

@media(max-width: 1100px){
  .order-topbar{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .order-toolbar-actions{
    justify-content:flex-start;
    overflow-x:auto;
    white-space:nowrap;
    padding-bottom:4px;
    scrollbar-width:none;
  }
  .today-order-filterbar{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .today-order-filterbar .filter-search-wrap{
    max-width:100%;
  }
  .today-inline-date-wrap{
    justify-content:flex-start;
  }
}

@media(max-width: 768px){
  .today-xls-main{
    min-height:420px;
  }
  .today-days-grid{
    grid-template-columns:repeat(2,1fr);
  }
  #todayOrderItemCount{
    margin-right:0;
  }
  .today-xls-table{
    min-width:1500px;
  }
  .modal-box.today-modal-box-haibukiya{
    width:98vw;
    padding:12px 10px;
  }
  .today-modal-box-haibukiya .today-modal-items-wrap{
    max-height:46vh;
  }
}
