* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.4;
    /* コンテンツが少ないページでもフッターが常に画面下部に固定されるようにする */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* 日付バリデーションのエラーメッセージ（入力欄の直下に吹き出し形式で表示、矢印で入力欄と視覚的に連結する） */
.field-error-msg {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 7px;
    background: #fff5f5;
    border: 1px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
    font-size: 11px;
    line-height: 1.4;
    padding: 5px 9px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.15);
}
.field-error-msg::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    width: 8px;
    height: 8px;
    background: #fff5f5;
    border-left: 1px solid #dc3545;
    border-top: 1px solid #dc3545;
    transform: rotate(45deg);
}

/* モーダル内の縦積みフォーム（アカウント登録・編集など）では、
   吹き出しが次の項目に重ならないよう通常フローの下部テキストとして表示する */
.modal .field-error-msg {
    position: static;
    display: none;
    margin-top: 6px;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    white-space: normal;
}
.modal .field-error-msg::before {
    display: none;
}

/* サイドバー */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(0);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.sidebar-toggle-mobile {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
}

.sidebar-toggle-mobile:hover {
    background: rgba(79, 176, 84, 0.1);
    color: #4fb054;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link span {
    flex: 1;
}

/* ドロップダウンメニュー */
.nav-item-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 16px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-item-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(79, 176, 84, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-item-dropdown.active .dropdown-menu {
    max-height: 200px;
}

.dropdown-link {
    display: block;
    padding: 8px 20px 8px 52px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(79, 176, 84, 0.1);
}

.dropdown-link:hover {
    background: rgba(79, 176, 84, 0.1);
    color: #4fb054;
}

.nav-link:hover {
    color: #4fb054;
    background: rgba(79, 176, 84, 0.1);
}

.nav-link.active {
    color: #4fb054;
    background: rgba(79, 176, 84, 0.1);
    border-right: 3px solid #4fb054;
    font-weight: 600;
}

/* ヘッダー */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

.header-content {
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.sidebar.hidden+.header {
    margin-left: 0;
}

.sidebar {
    background: white;
    color: #333;
}

.sidebar-header {
    border-bottom-color: #e1e5e9;
}

.nav-link {
    color: #666;
}

.nav-link:hover,
.nav-link.active {
    color: #4fb054;
    background: rgba(79, 176, 84, 0.05);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 5px;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}





/* ユーザーセクション */
.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notifications {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.notifications:hover {
    background: rgba(79, 176, 84, 0.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.user-profile:hover {
    background: rgba(79, 176, 84, 0.1);
}



.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-weight: 500;
    color: #333;
}

/* ユーザードロップダウン */
.user-profile {
    position: relative;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.logout {
    color: #333;
}

.dropdown-item.logout:hover {
    background-color: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background-color: #e1e5e9;
    margin: 4px 0;
}

/* サイドバーのログアウトボタン */
.logout-sidebar {
    color: #666 !important;
}

.logout-sidebar:hover {
    background: rgba(79, 176, 84, 0.1) !important;
    color: #4fb054 !important;
}

/* メインコンテンツ */
.main-content {
    padding: 40px 20px;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
    flex: 1 0 auto;
}

/* ページタイトル */
.page-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    font-size: 25px;
    color: #4fb054;
}

/* フッター */
.footer {
    background: white;
    border-top: 1px solid #e1e5e9;
    padding: 20px;
    margin-top: 40px;
    text-align: center;
    flex: 0 0 auto;
}

.footer-content p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e1e5e9;
    background: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    color: #666;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: rgba(79, 176, 84, 0.2);
    color: #4fb054;
    border-bottom-color: #4fb054;
}

/* タブコンテンツ */
.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-bottom: 20px;
}

/* 円グラフセクション */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* 出荷一覧 */
.shipping-list {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.shipping-table,
.inventory-table,
.products-table,
.campaign-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.3;
}

.shipping-table th,
.inventory-table th,
.products-table th,
.campaign-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
    line-height: 1.2;
}

/* Permit align attributes to override default text-align */
.products-table th[align="center"],
.products-table td[align="center"] {
    text-align: center;
}

.products-table th[align="center"] a,
.products-table td[align="center"] a {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.products-table th[align="right"],
.products-table td[align="right"] {
    text-align: right;
}

.shipping-table td,
.inventory-table td,
.products-table td,
.campaign-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e1e5e9;
    color: #333;
    line-height: 1.6;
}

.shipping-table tbody tr:hover,
.inventory-table tbody tr:hover,
.products-table tbody tr:hover,
.campaign-table tbody tr:hover {
    background: rgba(79, 176, 84, 0.1);
}

/* Sticky Header Styles for Dashboard Tables */
.tab-content .table-container {
    max-height: 75vh;
    overflow: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.products-table thead th {
    position: sticky;
    z-index: 10;
    background: #e8f5e8 !important;
    background-clip: padding-box;
    line-height: normal;
    border-bottom: 2px solid #e1e5e9 !important;
}

/* Specific offsets for Profit Flash (multi-row header) */
#profitFlashTableHeaderCategory th {
    top: 0;
    height: 48px;
}

#profitFlashTableHeaderCategory th.sticky-col {
    height: 96px;
    /* Spans 2 rows */
}

/* Sticky Column Styles (Horizontal Sticky) */
.products-table .sticky-col {
    position: sticky !important;
    left: 0;
    z-index: 5;
    background: white !important;
    border-right: 1px solid #eee !important;
}

/* Corner cell: Both vertically and horizontally sticky */
.products-table thead th.sticky-col {
    z-index: 15;
    background: #f8f9fa !important;
}

/* Total row corner cell */
.products-table tr.total-row td.sticky-col {
    z-index: 6;
    background: #fdfdfd !important;
}

#profitFlashTableHeader th {
    top: 46px;
    height: 48px;
    border-top: none !important;
}

/* Default for other tables with single-row headers */
#topProductsTableHeader th,
#salesFlashTable thead th,
#periodComparisonTable thead th {
    top: 0;
}

/* 検索フィルター */
.search-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 検索セクション */
.search-section {
    margin-bottom: 30px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group.col-3 {
    grid-column: span 1;
    max-width: 25%;
}

.filter-group>label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #4fb054;
}

/* 価格範囲 */
.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range input {
    flex: 1;
    min-width: 0;
}

.price-range span {
    color: #666;
    font-weight: 500;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.primary {
    background: #4fb054;
    color: white;
    border-color: #4fb054;
}

.filter-btn.primary:hover {
    background: #247d29;
    border-color: #247d29;
}

.filter-btn.secondary {
    background: #333;
    color: white;
    border-color: #333;
}

.filter-btn.secondary:hover {
    background: #555;
    color: white;
}

/* アカウントテーブル */
.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.account-table th {
    background: #f8f9fa;
    padding: 12px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.account-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

.account-table tbody tr:hover {
    background-color: rgba(79, 176, 84, 0.1);
}

/* 製品テーブル */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.product-table th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.product-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

.product-table tbody tr:hover {
    background-color: rgba(79, 176, 84, 0.1);
}

/* 編集・削除ボタン */
.btn-small,
.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 4px;
}

.btn-edit {
    background: #4fb054;
    color: white;
}

.btn-edit:hover {
    background: #247d29;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* 登録ボタン */
.btn-register {
    padding: 8px 16px;
    background: #4fb054;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-register:hover {
    background: #247d29;
}

.btn-register i {
    font-size: 16px;
}

/* アカウント・製品リスト */
.account-list,
.product-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* ステータス追加 */
.status.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.suspended {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal form {
    width: 100%;
}

.modal p.error {
    color: #dc3545;
    margin-top: 4px;
}

p.error {
    color: red;
    font-size: 14px;
    margin-top: 5px;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-confirm,
.modal-content.modal-logout,
.modal-content.small-modal {
    max-width: 500px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow: auto
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

/* フォームスタイル */
.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #4fb054;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* ログアウト確認モーダル */
.modal-note {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

.btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn.danger:hover {
    background: #c82333;
    border-color: #c82333;
}

/* 表示製品追加ボタン */
.btn-add-product {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.btn-add-product:hover {
    background: #218838;
}

.btn-add-product i {
    font-size: 16px;
}

/* 製品在庫タブの製品追加ボタン */
.btn-add-product-inventory {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.btn-add-product-inventory:hover {
    background: #218838;
}

.btn-add-product-inventory i {
    font-size: 16px;
}

/* キャンペーンタブのキャンペーン追加ボタン */
.btn-add-campaign {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.btn-add-campaign:hover {
    background: #218838;
}

.btn-add-campaign i {
    font-size: 16px;
}

/* チャートとラベルのレイアウト */
.chart-with-labels {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-with-labels .chart {
    width: 100%;
}

/* 製品ラベルコンテナ */
.product-labels-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

/* 製品ラベル */
.product-labels {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.product-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.product-label:hover {
    background: #f8f9fa;
    border-color: #4fb054;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* 削除ボタン */
.btn-remove-product {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-product:hover {
    background: #f8d7da;
    color: #c82333;
}

.btn-remove-product i {
    font-size: 14px;
}

/* 製品検索モーダル */
.search-form {
    margin-bottom: 20px;
}

.search-results {
    margin-top: 20px;
}

.search-results h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.product-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #e1e5e9;
    transition: background-color 0.3s ease;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item:hover {
    background: #e9ecef;
}

.product-item .product-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.btn-add-to-chart {
    background: #4fb054;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-add-to-chart:hover {
    background: #247d29;
}

/* モーダルアニメーション */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
}

.sidebar.hidden~.main-content {
    margin-left: 0;
}



/* 統計カード */
.stats-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4fb054 0%, #247d29 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

/* 折れ線グラフ */
.chart-section {
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.chart-header h3:not(.title-icon) {
    color: #333;
}

.title-icon {
    color: #4fb054;
    flex-shrink: 0;
    display: inline-block;
    font-size: 20px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.time-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #333;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #555;
    color: white;
    background: #555;
}

.filter-btn.active {
    background: #555;
    color: white;
    border-color: #555;
}

.chart-header h3 {
    color: white;
}


.title-icon {
    color: #4fb054;
}

.date-selector {
    background: #333;
    border-color: #444;
}

.selector-group label {
    color: #ccc;
}

.selector-group input {
    background: #2a2a2a;
    color: white;
    border-color: #444;
}

.selector-group input:focus,
.selector-group select:focus {
    border-color: #4fb054;
}

.year-select {
    background: #2a2a2a;
    color: white;
    border-color: #444;
}

.year-select option {
    background: #2a2a2a;
    color: white;
}

/* 日付選択 */
.date-selector {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    margin: 0;
}

/* 売上トップ10の日付選択器 */
.top-products .date-selector {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

.top-products .selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-products .selector-group label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.top-products .selector-group input {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #495057;
    min-width: 140px;
}

.top-products .selector-group input:focus {
    outline: none;
    border-color: #4fb054;
    box-shadow: 0 0 0 2px rgba(79, 176, 84, 0.2);
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selector-group label {
    font-weight: 500;
    color: #333;
    font-size: 12px;
    min-width: 40px;
}

.selector-group input {
    padding: 6px 8px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.selector-group input:focus,
.selector-group select:focus {
    outline: none;
    border-color: #4fb054;
    box-shadow: 0 0 0 3px rgba(79, 176, 84, 0.1);
}

.year-select {
    padding: 6px 8px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.year-select option {
    padding: 8px;
}

.chart {
    width: 100%;
    height: 300px;
    position: relative;
}

/* スマホ対応のグラフ */
@media (max-width: 768px) {
    .chart-container {
        padding: 20px;
    }

    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-controls {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .time-filter {
        width: 100%;
        justify-content: space-between;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
    }

    .date-selector {
        margin-bottom: 15px;
        width: 100%;
    }

    .selector-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .selector-group label {
        min-width: auto;
    }

    .selector-group input,
    .selector-group select {
        width: 100%;
    }

    .chart {
        height: 250px;
    }
}

/* 売上上位商品一覧 */
.top-products {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-per-page label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.items-select {
    padding: 6px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.items-select:focus {
    outline: none;
    border-color: #4fb054;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
}

/* 製品テーブルの横スクロール対応 */
.account-table {
    min-width: 1200px;
}

.products-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 16px;
}

/* 売上トップ10テーブルコンテナ */
.top-products .table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
}

.products-table th {
    background: #f8f9fa;
    padding: 12px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
    white-space: nowrap;
}

/* 売上トップ10テーブルのヘッダー背景 */
.top-products .products-table th {
    background: #e8f5e8;
    color: #2d5a2d;
}

/* 売上トップ10のヘッダー項目名のフォント色 */
.top-products .products-table th a {
    color: #2d5a2d;
}

/* 売上トップ10の金額、数値項目名を右寄せ */
.top-products .products-table th:nth-child(3),
.top-products .products-table th:nth-child(4),
.top-products .products-table th:nth-child(5),
.top-products .products-table th:nth-child(6),
.top-products .products-table th:nth-child(7),
.top-products .products-table th:nth-child(8),
.top-products .products-table th:nth-child(9) {
    text-align: right;
}

/* モール別売上ベスト10のヘッダー項目名のフォント色 */
.mall-sales-best10 .mall-sales-table th a {
    color: #2d5a2d !important;
}

/* モール別売上ベスト10の金額、数値項目名を右寄せ */
.mall-sales-best10 .mall-sales-table th:nth-child(3),
.mall-sales-best10 .mall-sales-table th:nth-child(4),
.mall-sales-best10 .mall-sales-table th:nth-child(5),
.mall-sales-best10 .mall-sales-table th:nth-child(6),
.mall-sales-best10 .mall-sales-table th:nth-child(7),
.mall-sales-best10 .mall-sales-table th:nth-child(8) {
    text-align: right;
}

/* 前年比売上のヘッダー項目名のフォント色 */
.yoy-sales-table th a {
    color: #2d5a2d;
}

/* 前年比売上のヘッダー項目名のホバー時のスタイル */
.yoy-sales-table th a:hover {
    color: #2d5a2d !important;
    text-decoration: none;
}

/* 前年比売上の金額、数値項目名を右寄せ */
.yoy-sales-table th:nth-child(3),
.yoy-sales-table th:nth-child(4),
.yoy-sales-table th:nth-child(5),
.yoy-sales-table th:nth-child(6),
.yoy-sales-table th:nth-child(7),
.yoy-sales-table th:nth-child(8),
.yoy-sales-table th:nth-child(9),
.yoy-sales-table th:nth-child(10) {
    text-align: right;
}

/* 売上トップ10テーブルの列幅調整 */
.top-products .products-table th:nth-child(1),
.top-products .products-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

/*.top-products .products-table th:nth-child(2),*/
/*.top-products .products-table td:nth-child(2) {*/
/*    width: 180px;*/
/*    min-width: 180px;*/
/*}*/

.top-products .products-table th:nth-child(3),
.top-products .products-table td:nth-child(3),
.top-products .products-table th:nth-child(4),
.top-products .products-table td:nth-child(4) {
    width: 100px;
    text-align: right;
}

.top-products .products-table th:nth-child(5),
.top-products .products-table td:nth-child(5) {
    width: 100px;
    text-align: right;
}

.top-products .products-table th:nth-child(6),
.top-products .products-table td:nth-child(6),
.top-products .products-table th:nth-child(7),
.top-products .products-table td:nth-child(7),
.top-products .products-table th:nth-child(8),
.top-products .products-table td:nth-child(8),
.top-products .products-table th:nth-child(9),
.top-products .products-table td:nth-child(9) {
    width: 110px;
    text-align: right;
}

a.no-underline {
    text-decoration: none;
    color: inherit;
}

.page-link {
    text-decoration: none;
    color: gray;
}

.pagination-btn.active .page-link {
    color: #fff;
}

.sort-link {
    color: #333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.sort-link:hover,
.sort-link.active {
    color: #4fb054;
}

.sort-link i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

table:has(.sort-link.active) .sort-link:not(.active) i {
    display: none;
}

/* 在庫レベルとステータスのスタイル */
.level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 40px;
}

.level.high {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.level.medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.level.low {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 40px;
}

.status.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.discontinued {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status.scheduled {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status.ended {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.draft {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* アカウントページのスタイル */
.account-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/*
.profile-form,
.password-form,
.notification-settings {
    max-width: 600px;
}
    */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #4fb054;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: 1px solid;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: #4fb054;
    color: white;
    border-color: #4fb054;
}

.btn.primary:hover {
    background: #247d29;
    border-color: #247d29;
}

.btn.secondary {
    background: white;
    color: #4fb054;
    border-color: #4fb054;
}

.btn.secondary:hover {
    background: #4fb054;
    color: white;
}

.setting-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background-color: #4fb054;
    border-color: #4fb054;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.products-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e1e5e9;
    color: #333;
}

.products-table tbody tr:hover {
    background: rgba(79, 176, 84, 0.1);
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 12px;
    color: white;
    background: #6c757d;
}

.rank-1 {
    background: #ffd700;
    color: #333;
}

.rank-2 {
    background: #c0c0c0;
    color: #333;
}

.rank-3 {
    background: #cd7f32;
    color: white;
}

.text-center {
    text-align: center;
}

input[type="checkbox"]:checked+label,
input[type="radio"]:checked+label {
    background-color: #4fb054;
    color: white;
    border-color: #4fb054;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.pagination-btn {
    list-style: none;
    border: 2px solid #e1e5e9;
    background: white;
    color: #666;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn .page-link {
    padding: 8px 12px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover .page-link {
    color: #4fb054;
}

.pagination-btn:hover:not(.disabled) {
    border-color: #4fb054;
    color: #4fb054;
    background: rgba(79, 176, 84, 0.1);
}

.pagination-btn.active {
    background: #4fb054;
    color: white;
    border-color: #4fb054;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #666;
    font-size: 14px;
    padding: 0 8px;
}

/* クイックアクション */
.quick-actions {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: white;
    border-color: #4fb054;
    color: #4fb054;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 176, 84, 0.2);
}

/* スマホ対応 */
@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
        height: 60px;
    }

    .logo-section h1 {
        font-size: 20px;
    }

    .logo-image {
        height: 22px;
    }

    .nav-list {
        gap: 15px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    .user-section {
        gap: 15px;
    }

    .username {
        display: none;
    }



    .sidebar {
        transform: translateX(0);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .header {
        margin-left: 250px;
    }

    .main-content {
        margin-left: 250px;
    }

    .sidebar.hidden+.header {
        margin-left: 0;
    }

    .sidebar.hidden~.main-content {
        margin-left: 0;
    }

    .main-content {
        padding: 20px 15px;
    }

    .welcome-section h2 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .top-products,
    .quick-actions {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle-mobile {
        display: block;
    }

    .header {
        margin-left: 0;
        width: 100%;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .nav-list {
        display: block;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin-top: 10px;
    }

    .dropdown-link {
        padding: 6px 16px;
        font-size: 13px;
    }

    .header-content {
        justify-content: space-between;
    }

    .welcome-section h2 {
        font-size: 20px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-content h3 {
        font-size: 24px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    body {
        background: #f8f9fa;
        color: #333;
    }

    .header {
        background: white;
        border-bottom-color: #e1e5e9;
    }

    .logo-section h1 {
        color: #333;
    }

    .logo-image {
        filter: none;
    }

    .nav-link {
        color: #666;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #4fb054;
        background: rgba(79, 176, 84, 0.1);
    }

    .dropdown-menu {
        background: white;
        border-color: #e1e5e9;
    }

    .dropdown-link {
        color: #666;
    }

    .dropdown-link:hover {
        background: rgba(79, 176, 84, 0.1);
        color: #4fb054;
    }

    .username {
        color: #333;
    }

    .stat-card,
    .top-products,
    .quick-actions,
    .chart-container {
        background: white;
        color: #333;
    }

    .filter-btn {
        background: white;
        color: #666;
        border-color: #e1e5e9;
    }

    .filter-btn:hover {
        border-color: #4fb054;
        color: #4fb054;
        background: rgba(79, 176, 84, 0.1);
    }

    .filter-btn.active {
        background: #4fb054;
        color: white;
        border-color: #4fb054;
    }

    .stat-content h3 {
        color: #333;
    }

    .stat-content p {
        color: #666;
    }

    .products-table th {
        background: #f8f9fa;
        color: #333;
        border-bottom-color: #e1e5e9;
    }

    .products-table td {
        color: #333;
        border-bottom-color: #f0f0f0;
    }

    .products-table tbody tr:hover {
        background: rgba(79, 176, 84, 0.1);
    }

    .action-btn {
        background: #333;
        color: white;
    }

    .action-btn:hover {
        background: #444;
        color: #4fb054;
    }
}

/* 製品検索モーダル内のフォーム要素 */
.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.modal .form-input,
.modal .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal .form-input:focus,
.modal .form-select:focus {
    outline: none;
    border-color: #4fb054;
    box-shadow: 0 0 0 3px rgba(79, 176, 84, 0.1);
}

.modal .form-input::placeholder {
    color: #999;
}

.modal .form-select option {
    padding: 8px;
    background: white;
    color: #333;
}

/* 検索フォームのレイアウト */
.modal .search-form {
    margin-bottom: 20px;
}

.modal .search-form .form-group:last-child {
    margin-bottom: 0;
}

/* 検索アクションボタン */
.modal .search-actions {
    text-align: center;
}

.modal .search-actions .btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
}

/* 製品削除確認モーダル */
#productDeleteModal .modal-body {
    text-align: center;
    padding: 30px 20px;
}

#productDeleteModal .modal-body p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

#productDeleteModal .modal-note {
    font-weight: 600;
    color: #e74c3c;
    font-size: 18px;
    margin: 20px 0;
    padding: 15px;
    background: #fdf2f2;
    border: 1px solid #fadbd8;
    border-radius: 8px;
}

#productDeleteModal .btn.danger {
    background: #e74c3c;
    color: white;
    border: none;
}

#productDeleteModal .btn.danger:hover {
    background: #c0392b;
}

/* キャンペーン追加モーダル */
.campaign-list-modal {
    max-height: 400px;
    overflow-y: auto;
}

.campaign-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.3s ease;
}

.campaign-item:hover {
    border-color: #4fb054;
    box-shadow: 0 2px 8px rgba(79, 176, 84, 0.1);
}

.campaign-item:last-child {
    margin-bottom: 0;
}

.campaign-item .campaign-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.campaign-item .btn-add-to-chart {
    padding: 8px 16px;
    background: #4fb054;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.campaign-item .btn-add-to-chart:hover {
    background: #3d8b40;
    transform: translateY(-1px);
}

/* 表示製品追加モーダルの横幅を広げる */
#addProductModal .modal-content {
    max-width: 700px;
    width: 95%;
}

/* キャンペーン追加モーダルの横幅を広げる */
#campaignAddModal .modal-content {
    max-width: 700px;
    width: 95%;
}

#campaignRegisterModal .modal-content {
    width: 95%;
    max-width: 900px;
}

#campaignRegisterModal .campaign-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#campaignRegisterModal .form-group:nth-child(9),
#campaignRegisterModal .form-group:nth-child(8) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

#campaignRegisterModal .form-group:nth-child(8) textarea {
    resize: vertical;
    min-height: 150px;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
    grid-column: 1 / -1 !important;
}

#campaignRegisterModal .form-group:nth-child(8) textarea {
    resize: vertical;
    min-height: 150px;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

#campaignDescription {
    resize: vertical;
    min-height: 150px;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

#campaignRegisterModal #campaignDescription {
    resize: vertical;
    min-height: 150px;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
}

/*
#campaignRegisterModal .campaign-form textarea {
    resize: vertical;
    min-height: 150px;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
}
*/
@media (max-width: 768px) {
    #campaignRegisterModal .modal-content {
        width: 95%;
        /*
        max-width: none;
        */
    }

    #campaignRegisterModal .campaign-form {
        grid-template-columns: 1fr;
        /*
        gap: 15px;
        */
    }
}

/* 製品在庫アラート一覧 */
.inventory-alerts {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.alerts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.alerts-table th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.alerts-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.alerts-table tbody tr:hover {
    background: rgba(79, 176, 84, 0.1);
}

/* アラートレベルスタイル */
.alert-level {
    padding: 15px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    min-width: 40px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-level.success {
    background-color: #39d482;
    color: #ffffff;
    border: 1px solid #39d482;
}

.alert-level.critical {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-level.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-level.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* アクションボタン */
.btn-action {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.btn-action:hover {
    background: rgba(79, 176, 84, 0.1);
    color: #4fb054;
}

.btn-action:last-child {
    margin-right: 0;
}

/* 在庫数と閾値のスタイル */
.alerts-table td:nth-child(4),
.alerts-table td:nth-child(5) {
    font-weight: 600;
    text-align: center;
}

.alerts-table td:nth-child(4) {
    color: #721c24;
}

.alerts-table td:nth-child(5) {
    color: #666;
}

/* アラート日時のスタイル */
.alerts-table td:nth-child(6) {
    font-size: 13px;
    color: #888;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .alerts-table {
        font-size: 13px;
    }

    .alerts-table th,
    .alerts-table td {
        padding: 10px 8px;
    }

    .alert-level {
        font-size: 12px;
        min-width: 50px;
        padding: 3px 6px;
    }

    .btn-action {
        font-size: 14px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .alerts-table {
        font-size: 12px;
    }

    .alerts-table th,
    .alerts-table td {
        padding: 8px 6px;
    }

    .alert-level {
        font-size: 10px;
        min-width: 45px;
        padding: 2px 4px;
    }

    .btn-action {
        font-size: 13px;
        padding: 3px;
    }
}

#accountModal .modal-content {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#accountModal .profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    justify-content: center;
    align-items: start;
}

#accountModal .form-group:nth-child(6) {
    grid-column: 1 / -1;
}


#accountModal .form-group:nth-child(7),
#accountModal .form-group:nth-child(8) {
    grid-column: span 1;
}

@media (max-width: 768px) {
    #accountModal .modal-content {
        width: 95%;
        max-width: none;
    }

    #accountModal .profile-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

#settingsModal .modal-content {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#settingsModal .profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    #settingsModal .modal-content {
        width: 95%;
        max-width: none;
    }

    #settingsModal .profile-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80vw;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .main-content,
    .header {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* 製造計画登録モーダル専用スタイル */
#manufacturingPlanRegisterModal .modal-content {
    max-width: 800px;
    width: 95%;
}

#manufacturingPlanRegisterModal .manufacturing-plan-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#manufacturingPlanRegisterModal .form-group:nth-child(11),
#manufacturingPlanRegisterModal .form-group:nth-child(12) {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    #manufacturingPlanRegisterModal .modal-content {
        max-width: 95%;
    }

    #manufacturingPlanRegisterModal .manufacturing-plan-form {
        grid-template-columns: 1fr;
    }
}

/* 製品テーブルの固定列 */


/* モール商品コード登録テーブルの固定列 */
.form-table-container {
    overflow-x: auto;
    position: relative;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
}

.form-table {
    min-width: 2800px;
    position: relative;
    border-collapse: collapse;
    table-layout: fixed;
    width: 2800px;
    background: white;
}

/* テーブルの列幅を明示的に設定 */
.form-table colgroup {
    display: table-column-group;
}

.form-table col:nth-child(1) {
    width: 250px;
}

.form-table col:nth-child(2) {
    width: 250px;
}

.form-table col:nth-child(3) {
    width: 100px;
}

.form-table col:nth-child(n+4) {
    width: 200px;
}

/* 固定列の基本設定 */
.form-table th,
.form-table td {
    border: 1px solid #e1e5e9;
    padding: 8px;
    vertical-align: top;
}

/* 固定列の設定 - classベース */
.sticky-col-1 {
    position: sticky !important;
    left: 0 !important;
    background: white !important;
    z-index: 100 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    border-right: 1px solid #e1e5e9 !important;
}

.sticky-col-2 {
    position: sticky !important;
    left: 250px !important;
    background: white !important;
    z-index: 100 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    border-right: 1px solid #e1e5e9 !important;
}

.sticky-col-3 {
    position: sticky !important;
    left: 500px !important;
    background: white !important;
    z-index: 100 !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    border-right: 1px solid #e1e5e9 !important;
}

/* rowspanセルの処理 */
.form-table td[rowspan] {
    background: white !important;
}

/* 固定列の背景を確実に設定 */
.sticky-col-1,
.sticky-col-2,
.sticky-col-3 {
    background: white !important;
    background-color: white !important;
    background-image: none !important;
}







/* 製品1〜10の列の幅設定 */
.form-table th:nth-child(n+4),
.form-table td:nth-child(n+4) {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    background: #f8f9fa;
}

/* 製品列のホバー効果 */
.form-table tbody tr:hover td:nth-child(n+4) {
    background: #e9ecef !important;
}

/* 固定列のホバー効果 */
.form-table tbody tr:hover .sticky-col-1,
.form-table tbody tr:hover .sticky-col-2,
.form-table tbody tr:hover .sticky-col-3 {
    background: white !important;
}

/* スクロール時の見た目改善 */
.form-table-container::-webkit-scrollbar {
    height: 8px;
}

.form-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.form-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.form-table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 固定列の動作を確実にする */
.form-table th,
.form-table td {
    background-clip: padding-box;
}

/* 必須項目用の薄いピンク背景色 */
.required-field {
    background-color: #fff0f0 !important;
    border-color: #ff9999 !important;
}

.required-field:focus {
    background-color: #fff8f8 !important;
    border-color: #ff6666 !important;
    box-shadow: 0 0 0 2px rgba(255, 102, 102, 0.2) !important;
}

/* 期間切り替えタブのスタイル */
.period-tabs {
    display: flex;
    gap: 4px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin-right: 20px;
}

.period-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.period-tab:hover {
    background-color: #e9ecef;
    color: #495057;
}

.period-tab.active {
    background-color: #4fb054;
    color: white;
    box-shadow: 0 2px 4px rgba(79, 176, 84, 0.2);
}

.period-tab.active:hover {
    background-color: #45a049;
}

/* 前期間比のスタイル */
.positive {
    color: #28a745;
    font-weight: 600;
}

.negative {
    color: #dc3545;
    font-weight: 600;
}

/* 売上トップ10の数値データスタイル */
.top-products .products-table td {
    font-size: 15px;
}

/* 注文関連データのスタイル */
.top-products .products-table td:nth-child(6),
.top-products .products-table td:nth-child(7),
.top-products .products-table td:nth-child(8),
.top-products .products-table td:nth-child(9) {
    font-weight: 500;
    color: #495057;
}

/* モバイルでの期間タブ調整 */
@media (max-width: 768px) {
    .period-tabs {
        margin-right: 10px;
        margin-bottom: 10px;
    }

    .period-tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    .table-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* 売上トップ10のモバイル調整 */
    .top-products .date-selector {
        margin-left: 0;
        margin-top: 10px;
    }

    .top-products .selector-group input {
        min-width: 120px;
    }

    .top-products .products-table {
        font-size: 14px;
        min-width: 900px;
    }

    .top-products .products-table th,
    .top-products .products-table td {
        padding: 8px 6px;
    }

    .top-products .products-table th:nth-child(2),
    .top-products .products-table td:nth-child(2) {
        /*width: 150px;*/
        /*min-width: 150px;*/
    }

    .top-products .products-table th:nth-child(3),
    .top-products .products-table td:nth-child(3),
    .top-products .products-table th:nth-child(4),
    .top-products .products-table td:nth-child(4),
    .top-products .products-table th:nth-child(5),
    .top-products .products-table td:nth-child(5) {
        width: 80px;
    }

    .top-products .products-table th:nth-child(6),
    .top-products .products-table td:nth-child(6),
    .top-products .products-table th:nth-child(7),
    .top-products .products-table td:nth-child(7),
    .top-products .products-table th:nth-child(8),
    .top-products .products-table td:nth-child(8),
    .top-products .products-table th:nth-child(9),
    .top-products .products-table td:nth-child(9) {
        width: 90px;
    }
}

/* モール別売上ベスト10セクション */
.mall-sales-best10 {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

/* モール別売上ベスト10テーブルのヘッダー背景 */
.mall-sales-best10 .mall-sales-table th {
    background: #e8f5e8 !important;
    color: #2d5a2d !important;
}

/* モール別売上ベスト10のヘッダー行の背景を固定 */
.mall-sales-best10 .mall-sales-table thead th,
.mall-sales-best10 .mall-sales-table thead tr th {
    background: #e8f5e8 !important;
    color: #2d5a2d !important;
}

/* モールタブの状態に関係なくヘッダー背景を固定 */
.mall-sales-best10 .mall-sales-table thead th:hover,
.mall-sales-best10 .mall-sales-table thead tr th:hover,
.mall-sales-best10 .mall-sales-table thead th:active,
.mall-sales-best10 .mall-sales-table thead tr th:active,
.mall-sales-best10 .mall-sales-table thead th:focus,
.mall-sales-best10 .mall-sales-table thead tr th:focus {
    background: #e8f5e8 !important;
    color: #2d5a2d !important;
}

.mall-sales-best10 .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.mall-sales-best10 h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mall-sales-best10 .title-icon {
    color: #4fb054;
    font-size: 22px;
}

/* モール切り替えタブのスタイル */
.mall-tabs {
    display: flex;
    gap: 4px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin-right: 20px;
}

.mall-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.mall-tab:hover {
    background-color: #e9ecef;
    color: #495057;
}

.mall-tab.active {
    background-color: #4fb054;
    color: white;
    box-shadow: 0 2px 4px rgba(79, 176, 84, 0.2);
}

.mall-tab.active:hover {
    background-color: #45a049;
}

/* モール別の色分け */
.mall-tab[data-mall="amazon"].active {
    background-color: #FF9900;
}

.mall-tab[data-mall="amazon"].active:hover {
    background-color: #e68900;
}

.mall-tab[data-mall="yahoo"].active {
    background-color: #FF0033;
}

.mall-tab[data-mall="yahoo"].active:hover {
    background-color: #e6002e;
}

.mall-tab[data-mall="rakuten"].active {
    background-color: #BF0000;
}

.mall-tab[data-mall="rakuten"].active:hover {
    background-color: #a60000;
}

/* モール別売上テーブル */
.mall-sales-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mall-sales-table th {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border: none;
    transition: background 0.3s ease;
}

/* モール別のヘッダー色分け */
.mall-sales-table thead tr.amazon-header th {
    background: linear-gradient(135deg, #FF9900 0%, #e68900 100%);
}

.mall-sales-table thead tr.yahoo-header th {
    background: linear-gradient(135deg, #FF0033 0%, #e6002e 100%);
}

.mall-sales-table thead tr.rakuten-header th {
    background: linear-gradient(135deg, #BF0000 0%, #a60000 100%);
}

.mall-sales-table th:first-child {
    border-top-left-radius: 8px;
}

.mall-sales-table th:last-child {
    border-top-right-radius: 8px;
}

/* モール別売上ベスト10テーブルの列幅調整 */
.mall-sales-best10 .mall-sales-table th:nth-child(1),
.mall-sales-best10 .mall-sales-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

.mall-sales-best10 .mall-sales-table th:nth-child(2),
.mall-sales-best10 .mall-sales-table td:nth-child(2) {
    width: 180px;
    min-width: 180px;
}

.mall-sales-best10 .mall-sales-table th:nth-child(3),
.mall-sales-best10 .mall-sales-table td:nth-child(3) {
    width: 120px;
    text-align: right;
}

.mall-sales-best10 .mall-sales-table th:nth-child(4),
.mall-sales-best10 .mall-sales-table td:nth-child(4) {
    width: 100px;
    text-align: right;
}

.mall-sales-best10 .mall-sales-table th:nth-child(5),
.mall-sales-best10 .mall-sales-table td:nth-child(5),
.mall-sales-best10 .mall-sales-table th:nth-child(6),
.mall-sales-best10 .mall-sales-table td:nth-child(6),
.mall-sales-best10 .mall-sales-table th:nth-child(7),
.mall-sales-best10 .mall-sales-table td:nth-child(7),
.mall-sales-best10 .mall-sales-table th:nth-child(8),
.mall-sales-best10 .mall-sales-table td:nth-child(8) {
    width: 110px;
    text-align: right;
}

.mall-sales-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 16px;
    color: #333;
}

.mall-sales-table tbody tr:hover {
    background: rgba(79, 176, 84, 0.1);
}

.mall-sales-table tbody tr:last-child td {
    border-bottom: none;
}

/* モール別売上ベスト10の数値データスタイル */
.mall-sales-best10 .mall-sales-table td {
    font-size: 15px;
}

/* 注文関連データのスタイル */
.mall-sales-best10 .mall-sales-table td:nth-child(5),
.mall-sales-best10 .mall-sales-table td:nth-child(6),
.mall-sales-best10 .mall-sales-table td:nth-child(7),
.mall-sales-best10 .mall-sales-table td:nth-child(8) {
    font-weight: 500;
    color: #495057;
}

/* 注文者数の色分け */
.mall-sales-best10 .mall-sales-table td:nth-child(7) {
    color: #007bff;
    font-weight: 600;
}

.mall-sales-best10 .mall-sales-table td:nth-child(8) {
    color: #28a745;
    font-weight: 600;
}

/* モール別の行の色分け */
.mall-sales-table tbody tr[data-mall="amazon"]:hover {
    background: rgba(79, 176, 84, 0.1);
}

.mall-sales-table tbody tr[data-mall="yahoo"]:hover {
    background: rgba(79, 176, 84, 0.1);
}

.mall-sales-table tbody tr[data-mall="rakuten"]:hover {
    background: rgba(79, 176, 84, 0.1);
}

/* モバイルでのモールタブ調整 */
@media (max-width: 768px) {
    .mall-tabs {
        margin-right: 10px;
        margin-bottom: 10px;
    }

    .mall-tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    .mall-sales-best10 .table-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mall-sales-table {
        font-size: 15px;
        min-width: 900px;
    }

    .mall-sales-best10 .mall-sales-table th:nth-child(2),
    .mall-sales-best10 .mall-sales-table td:nth-child(2) {
        width: 150px;
        min-width: 150px;
    }

    .mall-sales-best10 .mall-sales-table th:nth-child(3),
    .mall-sales-best10 .mall-sales-table td:nth-child(3),
    .mall-sales-best10 .mall-sales-table th:nth-child(4),
    .mall-sales-best10 .mall-sales-table td:nth-child(4) {
        width: 80px;
    }

    .mall-sales-best10 .mall-sales-table th:nth-child(5),
    .mall-sales-best10 .mall-sales-table td:nth-child(5),
    .mall-sales-best10 .mall-sales-table th:nth-child(6),
    .mall-sales-best10 .mall-sales-table td:nth-child(6),
    .mall-sales-best10 .mall-sales-table th:nth-child(7),
    .mall-sales-best10 .mall-sales-table td:nth-child(7),
    .mall-sales-best10 .mall-sales-table th:nth-child(8),
    .mall-sales-best10 .mall-sales-table td:nth-child(8) {
        width: 90px;
    }

    .mall-sales-table th,
    .mall-sales-table td {
        padding: 10px 8px;
    }
}

/* 前年比売上セクション */
.year-over-year-sales {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.year-over-year-sales .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.year-over-year-sales h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-over-year-sales .title-icon {
    color: #4fb054;
    font-size: 22px;
}

/* 年選択セレクター */
.year-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
}

.year-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.year-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.year-select:focus {
    outline: none;
    border-color: #4fb054;
    box-shadow: 0 0 0 2px rgba(79, 176, 84, 0.2);
}

/* 前年比売上グラフコンテナ */
.yoy-chart-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e1e5e9;
}

.yoy-chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* 前年比売上テーブル */
.yoy-sales-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 前年比売上テーブルコンテナ */
.year-over-year-sales .table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
}

.yoy-sales-table th {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

/* 前年比売上テーブルの列幅調整 */
.yoy-sales-table th:nth-child(1),
.yoy-sales-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

.yoy-sales-table th:nth-child(2),
.yoy-sales-table td:nth-child(2) {
    width: 180px;
    min-width: 180px;
}

.yoy-sales-table th:nth-child(3),
.yoy-sales-table td:nth-child(3),
.yoy-sales-table th:nth-child(4),
.yoy-sales-table td:nth-child(4) {
    width: 120px;
    text-align: right;
}

.yoy-sales-table th:nth-child(5),
.yoy-sales-table td:nth-child(5),
.yoy-sales-table th:nth-child(6),
.yoy-sales-table td:nth-child(6) {
    width: 100px;
    text-align: right;
}

.yoy-sales-table th:nth-child(7),
.yoy-sales-table td:nth-child(7),
.yoy-sales-table th:nth-child(8),
.yoy-sales-table td:nth-child(8),
.yoy-sales-table th:nth-child(9),
.yoy-sales-table td:nth-child(9),
.yoy-sales-table th:nth-child(10),
.yoy-sales-table td:nth-child(10) {
    width: 110px;
    text-align: right;
}

.yoy-sales-table th:first-child {
    border-top-left-radius: 8px;
}

.yoy-sales-table th:last-child {
    border-top-right-radius: 8px;
}

.yoy-sales-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 16px;
    color: #333;
}

.yoy-sales-table tbody tr:hover {
    background: rgba(79, 176, 84, 0.1);
}

.yoy-sales-table tbody tr:last-child td {
    border-bottom: none;
}

/* 成長率と成長額のスタイル */
.yoy-sales-table .positive {
    color: #28a745;
    font-weight: 600;
}

.yoy-sales-table .negative {
    color: #dc3545;
    font-weight: 600;
}

/* 数値データのスタイル */
.yoy-sales-table td {
    font-size: 15px;
}

/* 注文関連データのスタイル */
.yoy-sales-table td:nth-child(7),
.yoy-sales-table td:nth-child(8),
.yoy-sales-table td:nth-child(9),
.yoy-sales-table td:nth-child(10) {
    font-weight: 500;
    color: #495057;
}

/* 注文者数の色分け */
.yoy-sales-table td:nth-child(9) {
    color: #007bff;
    font-weight: 600;
}

.yoy-sales-table td:nth-child(10) {
    color: #28a745;
    font-weight: 600;
}

/* モバイルでの前年比売上調整 */
@media (max-width: 768px) {
    .year-over-year-sales .table-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .year-selector {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .yoy-sales-table {
        font-size: 12px;
        min-width: 1000px;
    }

    .yoy-sales-table th,
    .yoy-sales-table td {
        padding: 8px 6px;
    }

    .yoy-sales-table th:nth-child(2),
    .yoy-sales-table td:nth-child(2) {
        width: 150px;
        min-width: 150px;
    }

    .yoy-sales-table th:nth-child(3),
    .yoy-sales-table td:nth-child(3),
    .yoy-sales-table th:nth-child(4),
    .yoy-sales-table td:nth-child(4) {
        width: 100px;
    }

    .yoy-sales-table th:nth-child(5),
    .yoy-sales-table td:nth-child(5),
    .yoy-sales-table th:nth-child(6),
    .yoy-sales-table td:nth-child(6) {
        width: 80px;
    }

    .yoy-sales-table th:nth-child(7),
    .yoy-sales-table td:nth-child(7),
    .yoy-sales-table th:nth-child(8),
    .yoy-sales-table td:nth-child(8),
    .yoy-sales-table th:nth-child(9),
    .yoy-sales-table td:nth-child(9),
    .yoy-sales-table th:nth-child(10),
    .yoy-sales-table td:nth-child(10) {
        width: 90px;
    }

    .yoy-chart-container {
        padding: 15px;
    }
}

/* アカウント編集モーダルのスタイル（登録モーダルと同じ） */
#editAccountModal .modal-content {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#editAccountModal .profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    #editAccountModal .modal-content {
        width: 95%;
        max-width: none;
    }

    #editAccountModal .profile-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 必須ラベルのスタイル */
.required-label {
    background-color: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    margin-left: 4px;
    display: inline-block;
    vertical-align: middle;
}

/* 確認モーダルのz-index調整 */
#accountRegisterConfirmModal,
#accountEditConfirmModal,
#accountDeleteModal {
    z-index: 3000;
}

/* 危険なボタンのスタイル */
.btn.danger {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #e74c3c;
}

.btn.danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

/* 削除アカウント情報のスタイル */
.delete-account-info {
    background-color: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.delete-account-info p {
    margin: 5px 0;
    color: #333;
}

.delete-account-info p:first-child {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 登録アカウント情報のスタイル */
.register-account-info {
    background-color: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.register-account-info p {
    margin: 8px 0;
    color: #333;
    display: flex;
    align-items: center;
}

.register-account-info p:first-child {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 600;
}

.register-account-info p strong {
    min-width: 120px;
    color: #555;
    font-weight: 500;
}

.register-account-info span {
    color: #333;
    font-weight: 400;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.sidebar-hidden #sidebar {
    /* display: none; */
}

.sidebar-visible #sidebar {
    /* display: block; */
}

@media (max-width: 1024px) {
    .md-top-5 {
        margin-top: 5px;
    }
}

.positive {
    color: #28a745;
    font-weight: 600;
}

.negative {
    color: #dc3545;
    font-weight: 600;
}


table td {
    white-space: nowrap;
}

#profitFlashTable tbody tr.total-row td {
    font-weight: 700 !important;
    background-color: #f8f9fa !important;
    padding: 10px 12px !important;
    border-bottom: none !important;
}

#profitFlashTable tbody td {
    padding: 8px 12px !important;
}

#profitFlashTable tbody tr.total-row {
    background-color: #f8f9fa !important;
    border-top: 2px solid #dee2e6 !important;
}

#profitFlashTable tbody tr.total-row:hover {
    background-color: #e9ecef !important;
}

.target-schedule-table tfoot tr:hover {
    background-color: #e9ecef !important;
}

/* 期間売上比較タブ - ヘッダー・検索条件 */
.period-comparison-section-header {
    align-items: flex-start;
}

.period-comparison-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.period-comparison-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.period-comparison-result-area {
    transition: opacity 0.3s ease;
}

.period-comparison-table-container {
    margin-bottom: 0;
}

.period-comparison-conditions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
}

.period-comparison-conditions-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.period-comparison-conditions-text {
    font-size: 14px;
    color: #333;
}

/* 期間売上比較タブ - モール名列の横幅 */
#periodComparisonTable th:first-child,
#periodComparisonTable td.period-comparison-mall-name {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
    vertical-align: middle;
    font-weight: 600;
    border-right: 1px solid #e1e5e9;
}

/* 期間売上比較タブ - 期間列の横幅（対象期間・比較期間・比較結果） */
#periodComparisonTable th:nth-child(2),
#periodComparisonTable .period-comparison-period-cell {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    white-space: nowrap;
    text-align: left !important;
}

/* 期間売上比較タブ - 比較結果行のスタイル */
#periodComparisonTable tbody tr.period-comparison-result-row {
    background-color: #f8f9fa !important;
    border-top: 2px solid #dee2e6 !important;
}

#periodComparisonTable tbody tr.period-comparison-result-row td {
    background-color: #f8f9fa !important;
    padding: 10px 12px !important;
}

#periodComparisonTable tbody tr.period-comparison-result-row .period-comparison-period-cell {
    font-weight: 700 !important;
}

/* 期間売上比較テーブル - 比較結果のプラスマイナス色分け */
#periodComparisonTable tbody td.positive {
    color: #28a745 !important;
    font-weight: 600 !important;
}

#periodComparisonTable tbody td.negative {
    color: #dc3545 !important;
    font-weight: 600 !important;
}

#periodComparisonTable tbody tr.period-comparison-row .period-comparison-period-cell {
    font-weight: 500;
}
