:root {
    --goq-red: #0f766e;
    --goq-orange: #0d9488;
    --table-header-bg: #f1f5f9;
    --table-header-text: #334155;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #0f172a;
}

body {
    font-family: "Meiryo", sans-serif;
    margin: 0;
    background: var(--bg-light);
    font-size: 12px;
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ----------------------------------------------------------------------------
 * 左サイドバー (固定メニュー)
 * ---------------------------------------------------------------------------- */
.sidebar {
    width: 240px;
    background: #1e293b; /* 落ち着いたダークチャコール */
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    z-index: 2000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo .system-title {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    background: #0f766e;
    padding: 6px 14px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.status-bar-vertical {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 8px;
    flex: 1;
}

.status-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px; /* 角丸 6px に統一 */
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    position: relative;
    box-sizing: border-box;
}

.status-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateY(-1px);
}

/* ステータス別カラーテーマ (薄明るい色＆アクティブハイライト) */
.status-tab.tab-new {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}
.status-tab.tab-new.active {
    background: #10b981 !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.status-tab.tab-payment {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}
.status-tab.tab-payment.active {
    background: #3b82f6 !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.status-tab.tab-yamato {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
}
.status-tab.tab-yamato.active {
    background: #0ea5e9 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
}

.status-tab.tab-teikeigai {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
    color: #d8b4fe;
}
.status-tab.tab-teikeigai.active {
    background: #a855f7 !important;
    border-color: #c084fc !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3) !important;
}

.status-tab.tab-ready {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fde68a;
}
.status-tab.tab-ready.active {
    background: #f59e0b !important;
    border-color: #fbbf24 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.status-tab.tab-exported {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}
.status-tab.tab-exported.active {
    background: #64748b !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3) !important;
}

.status-tab.tab-hold {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.status-tab.tab-hold.active {
    background: #ef4444 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.status-tab.active {
    z-index: 2;
}

.status-tab .count-badge,
.tab-flyout-menu .count-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    padding: 3px 9px;
    border-radius: 14px;
    font-weight: 900;
    order: 2;
    display: inline-block;
    min-width: 24px;
    text-align: center;
    position: static !important;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.status-tab.active .count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.flyout-indicator {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #cbd5e1;
    display: none;
}

.status-tab.tab-cancel {
    background: rgba(113, 113, 122, 0.1) !important;
    border-color: rgba(113, 113, 122, 0.2) !important;
    color: #a1a1aa !important;
}

.status-tab.tab-cancel.active {
    background: #52525b !important;
    border-color: #71717a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(82, 82, 91, 0.3) !important;
}

.status-tab.tab-cancel .count-badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.btn-reset-data {
    width: 100%;
    background: #ef4444 !important;
    color: #fff !important;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.btn-reset-data:hover {
    background: #dc2626 !important;
}

/* ----------------------------------------------------------------------------
 * 右コンテンツ容器
 * ---------------------------------------------------------------------------- */
.main-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

/* ----------------------------------------------------------------------------
 * 最上部ヘッダーのスマート化
 * ---------------------------------------------------------------------------- */
header {
    background: #ffffff; /* 真っ白背景 */
    color: var(--text-dark);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0; /* 下部に薄い境界線 */
    z-index: 10;
    flex-shrink: 0;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    max-width: 250px;
}

#status-text {
    font-size: 11px;
    color: #64748b !important;
}

.header-center {
    flex: 1;
    max-width: 600px;
}

#drop-zone {
    margin: 0;
    padding: 6px 12px;
    border: 2px dashed #0f766e;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    font-size: 11px;
    font-weight: bold;
    color: #0f766e;
    background: #f0fdfa;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#drop-zone:hover {
    background: #ccfbf1;
    border-color: #0d9488;
}

#drop-zone.pending {
    border-color: #ef4444;
    color: #ef4444;
    background-color: #fef2f2;
    animation: btn-warning-pulse 1.5s infinite;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-settings-trigger {
    background: #0f766e !important;
    color: #ffffff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-settings-trigger:hover {
    background: #0d9488 !important;
}

/* 選択受注を移動ツールバー */
.selection-action-bar {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.selection-label {
    font-size: 11px;
    color: #475569;
    font-weight: bold;
}

.selection-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.selection-buttons .btn-inline {
    border-radius: 6px;
    font-weight: bold;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.selection-buttons .btn-inline:hover {
    background: #f1f5f9;
    border-color: #0f766e;
    color: #0f766e;
}

.btn-unmerge { background: #fff !important; color: #ef4444 !important; border: 1px solid #ef4444 !important; }
.btn-merge { background: #fff !important; color: #10b981 !important; border: 1px solid #10b981 !important; }

/* 警告用バッジスタイル */
.batch-in-badge {
    background: #10b981;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 4px;
}

.batch-out-badge {
    background: #94a3b8;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 4px;
}

.count-badge.warning {
    background: #ef4444 !important;
    color: #fff !important;
    animation: badge-pulse 2s infinite;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
}

@keyframes badge-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 修正済みバッジ */
.edited-badge {
    background: #0ea5e9;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 4px;
}

/* クリポNGバッジ */
.ng-badge {
    background: #fff1f2;
    color: #e11d48;
    border: 2px solid #e11d48;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 4px;
    display: inline-block;
    vertical-align: middle;
    cursor: help;
}

/* モール別カラーバッジ */
.mall-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    margin-top: 3px;
    line-height: 1.2;
    border: 2px solid rgba(0,0,0,0.3);
}

.mall-tag i {
    font-style: normal;
    background: rgba(0,0,0,0.15);
    padding: 0 4px;
    border-radius: 2px;
    font-size: 10px;
    border: 1px solid rgba(255,255,255,0.3);
}

.tag-yahoo { background-color: #ff0033; border-color: #ffffff; box-shadow: 0 1px 2px rgba(15,23,42,0.3); } /* 白枠 */
.tag-rakuten { background-color: #bf0000; border-color: #000000; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }    /* 漆黒枠 */
.tag-au { background-color: #f15a22; border-color: #000000; box-shadow: 0 1px 2px rgba(2,44,34,0.3); }    /* 黒枠 */
.tag-default { background-color: #64748b; border-color: #334155; }

/* モール別カラーバッジ(ミニ) */
.mini-mall-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    border-radius: 3px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    margin-left: 3px;
    vertical-align: middle;
    border: 2px solid rgba(0,0,0,0.4);
}

.mini-yahoo { background-color: #ff0033; border-color: #ffffff; }
.mini-rakuten { background-color: #bf0000; border-color: #000000; }
.mini-au { background-color: #f15a22; border-color: #000000; }

/* モールタブの色分け設定 (統合整理) */

/* メインワークスペース */
main {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 12px;
    gap: 10px;
}

/* 上部パネル（ボタン＋ドロップゾーン） */
.sidebar .action-buttons-box {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar .btn-large-action {
    width: 100%;
    padding: 10px 14px;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    line-height: 1.2;
    box-sizing: border-box;
    position: relative;
}

.sidebar .btn-large-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateY(-1px);
}

.sidebar .btn-large-action#btn-clickpost-action {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.sidebar .btn-large-action#btn-clickpost-action.active {
    background: #10b981 !important; /* 鮮やかなエメラルドグリーン */
    border-color: #34d399 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}
.sidebar .btn-large-action#btn-clickpost-action.active:hover {
    background: #059669 !important;
    transform: translateY(-1px) !important;
}

.sidebar .btn-large-action#btn-yamato-action {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}
.sidebar .btn-large-action#btn-yamato-action.active {
    background: #0284c7 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}
.sidebar .btn-large-action#btn-yamato-action.active:hover {
    background: #0369a1 !important;
    transform: translateY(-1px) !important;
}

.sidebar .btn-large-action#btn-teikeigai-action {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}
.sidebar .btn-large-action#btn-teikeigai-action.active {
    background: #9333ea !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}
.sidebar .btn-large-action#btn-teikeigai-action.active:hover {
    background: #7e22ce !important;
    transform: translateY(-1px) !important;
}

.sidebar .btn-large-action#btn-print-orders {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.sidebar .btn-large-action#btn-print-orders.active {
    background: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}
.sidebar .btn-large-action#btn-print-orders.active:hover {
    background: #3b82f6 !important;
    transform: translateY(-1px) !important;
}
.sidebar .btn-large-action#btn-print-orders:disabled {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

.sidebar .btn-large-action#btn-mall-up {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.sidebar .btn-large-action#btn-mall-up.active {
    background: #d97706 !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    cursor: pointer !important;
}
.sidebar .btn-large-action#btn-mall-up.active:hover {
    background: #f59e0b !important;
    transform: translateY(-1px) !important;
}
.sidebar .btn-large-action#btn-mall-up:disabled {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

.sidebar .btn-large-action#btn-mall-up .count-badge {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.sidebar-actions-section {
    padding: 10px 12px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: bold;
    color: #94a3b8;
    padding: 4px 0 4px 8px;
    margin-bottom: 12px;
    text-align: left;
    border-left: 3px solid #0d9488;
    letter-spacing: 1px;
    background: transparent;
    box-shadow: none;
    text-transform: uppercase;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

#drop-zone {
    margin: 0;
    padding: 10px;
    border: 2px dashed var(--goq-red);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    font-size: 12px;
    font-weight: bold;
    color: var(--goq-red);
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

#drop-zone.pending {
    border-color: #e11d48;
    color: #e11d48;
    background-color: #fff1f2;
    animation: btn-warning-pulse 1.5s infinite;
}

.btn-cancel-pending {
    position: absolute;
    right: 10px;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.btn-cancel-pending:hover {
    background: #dc2626;
}

/* 警告メッセージボックス */
#warning-message-area {
    display: none;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

#warning-message-area.active {
    display: block;
}

.warning-box {
    background: #fff1f2;
    border: 1px solid #fda4af;
    border-left: 6px solid #e11d48;
    padding: 12px 16px;
    border-radius: 6px;
    color: #9f1239;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 同梱のみの場合のオレンジ警告ボックス */
.merge-warning-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 6px solid #f97316;
    padding: 12px 16px;
    border-radius: 6px;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* P7ボタンの点滅アニメーション */
.btn-warning-blink {
    animation: btn-warning-pulse 1.5s infinite;
    border: 2px solid #e11d48 !important;
}

/* P7ボタンの点滅アニメーション (同梱のみ) */
.btn-merge-blink {
    /* 点滅はしない設定 */
    border: 3px solid #f97316 !important;
}

@keyframes btn-merge-pulse {
    0% { background-color: #fff; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { background-color: #fff7ed; box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
    100% { background-color: #fff; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

@keyframes btn-warning-pulse {
    0% { background-color: #fff; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
    50% { background-color: #fee2e2; box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
    100% { background-color: #fff; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

#drop-zone.hover {
    border-color: #007bff;
    background: #e2e8f0;
}

/* ----------------------------------------------------------------------------
 * 検索パネル ＆ 処理・CSV入出力パネル
 * ---------------------------------------------------------------------------- */
.control-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
}

.accordion-section {
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    margin-bottom: 2px;
}

.accordion-toggle {
    background: #f8fafc;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.accordion-toggle::after {
    content: '▲';
    font-size: 9px;
    color: #64748b;
}

.accordion-section.collapsed .accordion-toggle::after {
    content: '▼';
}

.accordion-content {
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.accordion-section.collapsed .accordion-content {
    display: none;
}


.form-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.form-row label {
    min-width: 90px;
    text-align: right;
    color: #475569;
    font-weight: bold;
}

.form-row input, .form-row select {
    flex: 1;
    padding: 2px 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 11px;
}

.btn-inline {
    padding: 2px 8px;
    background: #e2e8f0;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.btn-inline:hover {
    background: #cbd5e1;
}

/* ----------------------------------------------------------------------------
 * モール切替タブ & データ表示グリッド
 * ---------------------------------------------------------------------------- */
.mall-tab-container {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    margin-top: 4px;
}

.mall-badge-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    bottom: -1px;
}

.mall-badge-tab.active {
    background: var(--mall-brand-color, var(--goq-orange));
    color: #fff;
    border-top: 3px solid var(--mall-brand-color, var(--goq-orange));
    border-left: 1px solid var(--mall-brand-color, var(--goq-orange));
    border-right: 1px solid var(--mall-brand-color, var(--goq-orange));
    border-bottom: 1px solid transparent;
    z-index: 2;
}
.mall-badge-tab.active .mall-count {
    background: #fff;
    color: var(--mall-brand-color, var(--goq-orange));
}
.mall-badge-tab.active .mall-icon-badge {
    background: #fff !important;
    color: var(--mall-brand-color, var(--goq-orange)) !important;
}

.mall-badge-tab .mall-count {
    position: absolute;
    background: var(--goq-orange);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 6px;
    font-weight: bold;
    top: -13px;
    right: -6px;
}

.grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 4px 4px 4px;
    overflow: hidden;
}

.table-scroll {
    flex: 1;
    overflow: auto;
}

.goq-table {
    width: auto;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.goq-table th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    border: 1px solid var(--border-color);
    padding: 6px;
    font-weight: bold;
    text-align: center;
    position: sticky;
    top: -2px;
    z-index: 100;
    -webkit-user-select: text;
    user-select: text;
}

/* リサイズハンドル */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 15;
    background-color: transparent;
    transition: background-color 0.1s;
}

.resize-handle:hover,
.goq-table th.resizing .resize-handle {
    background-color: #3b82f6; /* ホバー時またはリサイズ中に青線を出す */
}

.goq-table td {
    border: 1px solid var(--border-color);
    padding: 6px;
    vertical-align: top;
    background: #fff;
}

.goq-table tr:nth-child(even) td {
    background: #f8fafc;
}

/* 商品明細内のオプションテキスト */
.item-option-text {
    margin-top: 4px;
    margin-left: 12px;
    font-size: 13px;       /* 11pxから13pxへ拡大 */
    color: #475569;        /* 少し濃いグレーに変更して視認性アップ */
    line-height: 1.4;      /* 行間を整えて間延びを防ぐ */
}

.goq-table tr.selected td {
    background-color: transparent !important;
    position: relative;
    z-index: 10;
}

/* 疑似要素でテーブルの境界線ルールを無視し、赤枠の手前に青枠を被せて描画 */
.goq-table tr.selected td::after {
    content: "";
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    right: 0;
    border-top: 3px solid #1d4ed8;
    border-bottom: 3px solid #1d4ed8;
    pointer-events: none; /* クリック操作を阻害しない */
}

.goq-table tr.selected td:first-child::after {
    left: -2px;
    border-left: 3px solid #1d4ed8;
}

.goq-table tr.selected td:last-child::after {
    right: -2px;
    border-right: 3px solid #1d4ed8;
}

/* 同梱グループの強調表示（より太いオレンジ枠と薄黄背景） */
.goq-table tr.in-merge-group td {
    background-color: #fffbeb !important;
}
.goq-table tr.in-merge-group td:first-child { border-left: 5px solid #f59e0b !important; }
.goq-table tr.in-merge-group td:last-child { border-right: 5px solid #f59e0b !important; }
.goq-table tr.merge-group-top td { border-top: 5px solid #f59e0b !important; }
.goq-table tr.merge-group-bottom td { border-bottom: 5px solid #f59e0b !important; }

/* 制限NG（文字化け・文字数超過）行の警告強調表示（薄ピンク背景と赤枠） */
.goq-table tr.export-ng-row td {
    background-color: #fdf2f8 !important; /* 薄い警告ピンク */
    border-top: 2px solid #ef4444 !important;
    border-bottom: 2px solid #ef4444 !important;
}
.goq-table tr.export-ng-row td:first-child {
    border-left: 5px solid #ef4444 !important; /* 左側は特に太い警告線 */
}
.goq-table tr.export-ng-row td:last-child {
    border-right: 2px solid #ef4444 !important;
}

.goq-table tr.in-batch td {
    border-left: 3px solid #10b981;
}

/* 装飾パーツ */

.qty-highlight {
    background: #fef08a;
    border: 1px solid #eab308;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.address-sub-box {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #cbd5e1;
    color: #2563eb;
}

/* スタートアップガイド */
#startup-guide {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin: 15px;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    color: #64748b;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 450px;
}

#startup-guide:hover {
    border-color: var(--goq-red);
    background: #fef2f2;
}

.guide-icon {
    font-size: 80px;
    margin-bottom: 25px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.guide-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1e293b;
}

.guide-box {
    background: #f8fafc;
    padding: 30px 40px;
    border-radius: 10px;
    border-left: 8px solid var(--goq-red);
    text-align: left;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    max-width: 600px;
}

.guide-box strong {
    font-size: 18px;
    color: var(--goq-red);
    display: block;
    margin-bottom: 12px;
}

.guide-box p {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
}

/* 処理完了・ダウンロード画面 */
#success-view {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.success-icon {
    font-size: 80px;
    color: #059669;
    margin-bottom: 20px;
}

.success-title {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
}

.success-summary {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 30px;
}

.big-download-btn {
    padding: 18px 40px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.4);
    transition: all 0.2s ease;
}

.big-download-btn:hover {
    transform: scale(1.05);
    background: #16a34a;
}

.view-grid-link {
    margin-top: 25px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid #cbd5e1;
    cursor: pointer;
}

.view-grid-link:hover {
    color: var(--goq-red);
    border-color: var(--goq-red);
}

/* ----------------------------------------------------------------------------
 * 右側スライドイン：詳細表示兼ピッキングプレビュー画面
 * ---------------------------------------------------------------------------- */
.preview-drawer {
    position: fixed;
    right: -880px;
    top: 0;
    width: 850px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.preview-drawer.open {
    right: 0;
}

.drawer-close-btn {
    position: absolute;
    left: -38px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 30%;
    background: #f87171;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: bold;
    box-shadow: -4px 0 10px rgba(0,0,0,0.2);
    transition: background 0.2s;
    z-index: 10;
}

.drawer-close-btn:hover {
    background: #ef4444;
}

.drawer-close-btn::after {
    content: "CLOSE ◀";
    letter-spacing: 2px;
}

/* ドロワー左側の上下移動ナビゲーション */
.drawer-nav-container {
    position: absolute;
    left: -50px;
    top: 15%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10001;
}

.drawer-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.drawer-nav-btn:hover {
    background: #0ea5e9;
    transform: scale(1.1);
}

.drawer-nav-btn.disabled {
    background: #64748b;
    color: #94a3b8;
    border-color: #64748b;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.drawer-nav-tooltip {
    position: absolute;
    right: 55px; /* ボタンの左横に配置 */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.drawer-nav-container:hover .drawer-nav-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-5px);
}

.drawer-header {
    background: #1e293b;
    color: #fff;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    border-bottom: 1px solid #0f172a;
}

.drawer-tabs {
    display: flex;
    background: #0f172a;
    padding: 3px;
    border-radius: 6px;
    gap: 2px;
}

.drawer-tab {
    padding: 6px 15px;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.drawer-tab:hover {
    color: #f1f5f9;
}

.drawer-tab.active {
    background: #0ea5e9;
    color: #ffffff;
    font-weight: bold;
}

.drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#drawer-header-close-btn {
    background-color: #475569;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s, transform 0.1s;
}

#drawer-header-close-btn:hover {
    background-color: #334155;
    transform: translateY(-1px);
}

#drawer-header-close-btn:active {
    transform: translateY(0);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f1f5f9;
}

/* 詳細項目グリッド */
.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #fff;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
}

.detail-block h4 {
    margin: 0 0 4px 0;
    border-bottom: 2px solid #334155;
    padding-bottom: 2px;
    font-size: 11px;
}

.detail-block p {
    margin: 1px 0;
    line-height: 1.3;
    font-size: 11px;
}

/* ピッキング指示書レイアウト */
.picking-sheet {
    background: #fff;
    border: 1px solid #000;
    padding: 25px;
    box-sizing: border-box;
    font-size: 12px;
    color: #000;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.barcode-area {
    width: 160px;
    text-align: center;
    font-family: monospace;
    font-size: 10px;
}

.barcode-lines {
    height: 25px;
    background: repeating-linear-gradient(90deg, #000, #000 2px, #fff 2px, #fff 4px);
    margin-bottom: 2px;
}

.sheet-meta-block {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.address-box {
    border: 1px solid #000;
    padding: 8px;
    min-height: 80px;
    flex: 1;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
}

.items-table th, .items-table td {
    border: 1px solid #000;
    padding: 6px;
    font-size: 11px;
}

.items-table th {
    background: #f8fafc;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    z-index: 9999;
    border: 5px dashed var(--goq-red);
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
 * ログイン画面のスタイル (Modern Neubrutalism / Pop UI)
 * ---------------------------------------------------------------------------- */
.auth-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(247, 245, 240, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-card {
    background: #ffffff;
    border: 3px solid #22252a;
    border-radius: 24px;
    box-shadow: 6px 6px 0px 0px rgba(34, 37, 42, 1);
    padding: 36px 32px;
    color: #22252a;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-title {
    margin: 0 0 16px 0;
    color: #22252a;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.auth-error-msg {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.4;
    text-align: center;
}

.auth-error-msg:empty {
    margin: 0;
}

.auth-form {
    border-top: 2px dashed #f1f5f9;
    padding-top: 20px;
    text-align: left;
}

.auth-input-group {
    text-align: left;
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #22252a;
    margin-bottom: 6px;
}

.auth-req-star {
    color: #ef4444;
    margin-left: 2px;
    font-weight: 900;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 14px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 700;
    color: #22252a;
    transition: all 0.2s ease-in-out;
    background-color: #f9fafb;
    font-family: inherit;
}

.auth-input::placeholder {
    color: #9ca3af;
    font-weight: 600;
}

.auth-input:focus {
    outline: none;
    border-color: #f97316;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.auth-remember-group {
    margin-bottom: 16px;
    text-align: left;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #f97316;
    cursor: pointer;
    border-radius: 4px;
}

.auth-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
    color: #ffffff;
    border: 2.5px solid #22252a;
    border-radius: 14px;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.15s ease-in-out;
    box-shadow: 4px 4px 0px 0px rgba(34, 37, 42, 1);
    font-family: inherit;
    letter-spacing: 0.02em;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px rgba(34, 37, 42, 1);
}

.auth-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px rgba(34, 37, 42, 1);
}

.auth-note {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin: 10px 0 0 0;
    text-align: center;
    line-height: 1.4;
}

.auth-footer-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.auth-link {
    display: inline-block;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: color 0.2s, transform 0.2s;
}

.auth-link-primary {
    color: #ea580c;
    font-weight: 800;
}

.auth-link:hover {
    color: #c2410c;
    text-decoration: underline;
}

.auth-footer {
    font-size: 11px;
    font-weight: 700;
    margin-top: 20px;
    color: #94a3b8;
}

/* ----------------------------------------------------------------------------
 * ログアウト確認用オリジナルモーダル (Neubrutalism UI)
 * ---------------------------------------------------------------------------- */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}

.logout-modal-card {
    background: #ffffff;
    border: 3px solid #22252a;
    border-radius: 20px;
    box-shadow: 6px 6px 0px 0px rgba(34, 37, 42, 1);
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: logoutModalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoutModalPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.logout-modal-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 12px;
}

.logout-modal-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 900;
    color: #22252a;
}

.logout-modal-desc {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-modal-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #22252a;
    transition: all 0.15s ease-in-out;
    font-family: inherit;
}

.logout-modal-btn.btn-cancel {
    background-color: #f1f5f9;
    color: #475569;
    box-shadow: 3px 3px 0px 0px rgba(34, 37, 42, 1);
}

.logout-modal-btn.btn-cancel:hover {
    background-color: #e2e8f0;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px 0px rgba(34, 37, 42, 1);
}

.logout-modal-btn.btn-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 3px 3px 0px 0px rgba(34, 37, 42, 1);
}

.logout-modal-btn.btn-confirm:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px 0px rgba(34, 37, 42, 1);
}

/* ----------------------------------------------------------------------------
 * モーダル内テーブル用補完スタイル
 * ---------------------------------------------------------------------------- */
.export-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.export-table th {
    background: #f1f5f9;
    padding: 8px;
    border: 1px solid var(--border-color);
    font-weight: bold;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.export-table td {
    padding: 6px;
    border: 1px solid var(--border-color);
    background: #fff;
    vertical-align: middle;
}

.export-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-sizing: border-box;
}

.export-input:focus {
    outline: none;
    border-color: var(--goq-red);
    background-color: #fff;
}

.export-input.warning {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.char-count {
    color: #64748b;
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
 * 環境設定タブ用スタイル（色分け・境界線強調）
 * ---------------------------------------------------------------------------- */
.settings-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    color: #475569;
    background: #e2e8f0;
    border-top: 4px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab:hover {
    background: #d1d5db;
}

.settings-tab.active {
    background: #fff;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #fff;
    position: relative;
    z-index: 5;
    margin-bottom: -1px;
}

#st-tab-basic.active { border-top-color: #2563eb; color: #2563eb; }      /* 青：基本設定 */
#st-tab-design.active { border-top-color: #10b981; color: #10b981; }     /* 緑：表示デザイン設定 */
#st-tab-mapping.active { border-top-color: #ea580c; color: #ea580c; }    /* 橙：マッピング */
#st-tab-plan1.active { border-top-color: #059669; color: #059669; }      /* 緑：自動バックアップ */
#st-tab-plan2.active { border-top-color: #7c3aed; color: #7c3aed; }      /* 紫：予定2 */
#st-tab-rakuten.active { border-top-color: #bf0000; color: #bf0000; }    /* 赤：楽天設定 */
#st-tab-yahoo.active { border-top-color: #ff0033; color: #ff0033; }      /* 赤：Yahoo設定 */
#st-tab-au.active { border-top-color: #f15a22; color: #f15a22; }         /* 橙：au設定 */

/* 保存ボタン強調アニメーション */
@keyframes btn-pulse-highlight {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

.btn-save-highlight {
    animation: btn-pulse-highlight 1.5s infinite;
    border: 2px solid #fff !important;
}

/* 印刷判定バッジ・行グレーアウト */
.print-status-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    margin-top: 4px;
    min-width: 75px;
    white-space: nowrap;
    box-sizing: border-box;
}
.print-status-badge.printed {
    background-color: #dbeafe; /* マイルドな青 */
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.print-status-badge.unprinted {
    background-color: #fee2e2; /* マイルドな赤 */
    color: #991b1b;
    border: 1px solid #fecaca;
}
.goq-table tr.printed-row td {
    /* opacity: 0.6; */
    /* background-color: #f8fafc !important; 薄いグレーの背景 */
}

/* ============================================================================
 * 帳票レイアウトカスタマイズ機能追加・レスポンシブスタイル
 * ============================================================================ */

/* 詳細ドロワー内の「⚙ 帳票設定」ボタンの赤色強調 */
#drawer-header-settings-btn {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

#drawer-header-settings-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
}

#drawer-header-settings-btn:active {
    transform: translateY(0);
}

/* 店舗情報・帳票設定パネルのレイアウト調整 */
#settings-panel-plan2 {
    overflow: hidden;
}

#common-print-settings-container,
#shop-settings-containers {
    width: 100%;
    box-sizing: border-box;
}

/* 文字化けありバッジスタイル（ふわふわ点灯 - 1.5倍サイズ・2倍速・2倍光彩） */
.mojibake-warning-badge {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 15px;
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
    animation: mojibake-pulse 1s infinite alternate ease-in-out;
}

@keyframes mojibake-pulse {
    0% {
        opacity: 0.7;
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
    }
    100% {
        opacity: 1.0;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
    }
}

/* ============================================================================
 * 環境設定パネル内レイアウト・フォーム要素（自動処理設定など）
 * ============================================================================ */
.setting-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.setting-section-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.setting-description {
    font-size: 11px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    color: #334155;
    cursor: pointer;
    min-width: auto; /* .form-row label の上書き */
    text-align: left;
}

/* ============================================================================
 * アクションC: 配送方法による除外対象行のグレーアウトスタイル
 * ============================================================================ */
.goq-table tr.exclusion-row td {
    background-color: #f1f5f9 !important; /* 薄いグレーの背景 */
    color: #94a3b8; /* テキストも暗くして非アクティブ感を出す */
}

/* 該当理由を示すバッジ (ShipMethodNameの横などに表示) */
.exclusion-badge {
    background: #64748b;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 4px;
    display: inline-block;
}
/* 文字数オーバーバッジスタイル（ふわふわ点灯 - 1.5倍サイズ・2倍速・2倍光彩） */
.limit-over-badge {
    background: linear-gradient(135deg, #f97316, #eab308);
    color: white;
    font-size: 15px;
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.5);
    animation: limit-pulse 1s infinite alternate ease-in-out;
}

@keyframes limit-pulse {
    0% {
        opacity: 0.7;
        box-shadow: 0 0 4px rgba(249, 115, 22, 0.3);
    }
    100% {
        opacity: 1.0;
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.7);
    }
}

/* ============================================================================
 * 配送方法による除外対象行のグレーアウトとバッジ
 * ============================================================================ */
.goq-table tr.exclusion-row td {
    background-color: #e2e8f0 !important; /* より暗いグレーの背景に変更し、明確に区別 */
    color: #94a3b8 !important; /* テキストの色も統一して薄くし、非アクティブ感を強調 */
}

.exclusion-badge {
    background: #64748b;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
}

/* ============================================================================
 * ソートドロップダウンメニュー
 * ============================================================================ */
.sort-menu-container {
    position: absolute;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 170px;
    padding: 4px 0;
    margin-top: 4px;
    text-align: left;
    font-family: "Meiryo", sans-serif;
    font-size: 11px;
}

.sort-menu-item {
    padding: 8px 12px;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s, color 0.15s;
    font-weight: normal;
}

.sort-menu-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.sort-menu-item.active {
    font-weight: bold;
    color: #2563eb;
    background-color: #eff6ff;
}

.sort-menu-item .active-check {
    color: #2563eb;
    font-weight: bold;
    margin-left: 8px;
}

/* ----------------------------------------------------------------------------
 * 左サイドバー最下部のアコーディオン (選択受注を移動)
 * ---------------------------------------------------------------------------- */
.sidebar-accordion {
    width: 100%;
    margin-bottom: 8px;
    position: relative;
}

.sidebar-accordion[open] .accordion-title .arrow {
    transform: rotate(90deg);
}

.accordion-title {
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: 1px solid #818cf8;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-sizing: border-box;
    width: 100%;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
}

.accordion-title:hover {
    background: linear-gradient(135deg, #4338ca, #3730a3);
    border-color: #a5b4fc;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.sidebar-accordion[open] .accordion-title {
    background: linear-gradient(135deg, #3730a3, #312e81);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* detailsのデフォルトの黒三角矢印を消す */
.accordion-title::-webkit-details-marker {
    display: none;
}
.accordion-title::marker {
    display: none;
}

.accordion-title .arrow {
    transition: transform 0.2s;
    font-size: 9px;
}

.accordion-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    left: 100%;
    top: 0;
    width: 150px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
    padding: 8px;
    margin-top: 0;
    margin-left: 6px;
    z-index: 1000;
}

.sidebar-accordion .accordion-buttons {
    top: auto;
    bottom: 0;
}

/* タブとポップアウトメニューの隙間のマウス通過時にメニューが消えないようにするための透明な架け橋 */
.accordion-buttons::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -10px;
    width: 10px;
    background: transparent;
}

.btn-sidebar-move {
    width: 100%;
    padding: 8px 12px;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    text-align: left;
    transition: all 0.2s;
    box-sizing: border-box;
}

.btn-sidebar-move:hover {
    background: #0f766e; /* 深緑 */
    border-color: #0d9488;
    color: #fff;
}

/* Sidebar Move Buttons Colors */
.btn-sidebar-move.to-new { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); color: #a7f3d0; }
.btn-sidebar-move.to-new:hover { background: #10b981; border-color: #34d399; color: #fff; }

.btn-sidebar-move.to-yamato { background: rgba(14, 165, 233, 0.12); border-color: rgba(14, 165, 233, 0.25); color: #7dd3fc; }
.btn-sidebar-move.to-yamato:hover { background: #0ea5e9; border-color: #38bdf8; color: #fff; }

.btn-sidebar-move.to-teikeigai { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.btn-sidebar-move.to-teikeigai:hover { background: #a855f7; border-color: #c084fc; color: #fff; }

.btn-sidebar-move.to-ready { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); color: #fde68a; }
.btn-sidebar-move.to-ready:hover { background: #f59e0b; border-color: #fbbf24; color: #fff; }

.btn-sidebar-move.to-exported { background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.btn-sidebar-move.to-exported:hover { background: #64748b; border-color: #94a3b8; color: #fff; }

.btn-sidebar-move.to-completed { background: rgba(71, 85, 105, 0.1); border-color: rgba(71, 85, 105, 0.2); color: #cbd5e1; }
.btn-sidebar-move.to-completed:hover { background: #475569; border-color: #64748b; color: #fff; }

.btn-sidebar-move.to-hold { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.btn-sidebar-move.to-hold:hover { background: #ef4444; border-color: #f87171; color: #fff; }

.btn-sidebar-move.to-cancel { background: rgba(100, 116, 139, 0.1); border-color: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.btn-sidebar-move.to-cancel:hover { background: #475569; border-color: #64748b; color: #fff; }

/* 処理工程タブのホバー制御：アクティブなタブをホバーした時だけ表示し、離れると非表示 */
.status-tab .tab-flyout-menu {
    display: none !important;
}
.status-tab.active:hover .tab-flyout-menu {
    display: flex !important;
}

