/* iPhoneアクセシビリティ設定によるレイアウト崩れを防ぐ */
html {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

body {
    font-size: 16px !important;
}

:root {
    --primary-green: #5a8f6a;
    --light-green: #9bc47d;
    --soft-green: #c8e6c9;
    --pale-green: #e8f5e9;
    --text-dark: #2d4a3a;
    --text-medium: #5a7464;
    --text-light: #86a091;
    --bg-cream: #fafaf8;
    --bg-white: #ffffff;
    --border-light: #d4e4d9;
    --shadow-soft: 0 2px 8px rgba(90, 143, 106, 0.08);
    --shadow-medium: 0 4px 16px rgba(90, 143, 106, 0.12);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --transition: all 0.3s ease;
    
    /* カテゴリ別の色（ペールトーン統一） */
    --cut-color: #5a8f6a;        /* ヘアカット（既存のprimary-green） */
    --color-color: #7a9f8a;       /* ヘアカラー（少し青みがかった緑） */
    --perm-color: #6a8f7a;        /* パーマ（中間の緑） */
    --other-color: #8a9f7a;       /* その他（少し黄みがかった緑） */
}

body {
    font-family: "SF Pro Display", "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;
    background: linear-gradient(135deg, var(--pale-green) 0%, #f0f8f0 100%);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 20px;
    min-height: 100vh;
    font-size: 16px !important;
}

body.modal-open {
    overflow: hidden;
    /* position: fixed を削除してタッチイベントを保持 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* デスクトップ版ヘッダー */
.main-header {
    background: var(--pale-green);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 0 20px; /* 左パディングを削減 */
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0; /* flex: 1 から変更して幅を制限 */
    margin-left: 20px; /* ポッチから適度な距離 */
}

.header-center {
    display: none; /* 中央セクションを非表示 */
}

.header-center .logo {
    height: 40px;
    width: auto;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* モバイル版ヘッダー - 固定ヘッダーに変更 */
.mobile-header {
    background: var(--pale-green);
    padding: 12px 16px 12px 0px;
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between; /* flex-start → space-between（右端にボタンを配置） */
    width: 100%;
    padding: 0 20px 0 0px; /* 左パディングをさらに削減 */
    height: 100%;
}

.mobile-logo {
    flex: 0; /* flex: 1 から変更 */
    text-align: left; /* 左寄せに変更 */
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-left: 25px; /* ポッチから適度な距離 */
    margin-top: 3px; /* 上マージンを追加 */
}

/* 学マス風ハンバーガーボタン（Azureカラー版） */
.hamburger {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    width: 150px; /* 160px → 150px（さらに横幅を調整） */
    height: 50px; /* 縦幅は維持（押しやすさを保持） */
    padding: 0 20px; /* 24px → 20px（パディングをさらに調整） */
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 50%, var(--soft-green) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px; /* より丸く */
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(90, 143, 106, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002; /* status-dot-mobileより上に */
    margin-left: auto; /* 右端に固定 */
    margin-right: 40px; /* 32pxから40pxに変更して少し左寄りに */
    position: relative; /* 位置を安定化 */
}

.hamburger:hover {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    box-shadow: 0 8px 25px rgba(90, 143, 106, 0.5);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.6);
}

.hamburger:active {
    transform: translateY(0);
}

.hamburger.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
}

/* MENUテキスト */
.hamburger-text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    opacity: 1;
    transform: scale(1);
}

.hamburger:hover .hamburger-text {
    transform: scale(1.05);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* メニューが開いている時もテキストを表示 */
.hamburger.active .hamburger-text {
    opacity: 1;
    transform: scale(1);
}

/* 学マス風アイコン（2本線） */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 28px; /* 32px → 28px（少し小さく） */
    height: 22px; /* 26px → 22px（少し小さく） */
    position: relative;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3.5px; /* 4.5px → 3.5px（少し細く） */
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

.hamburger-icon span:nth-child(1) {
    top: 5px; /* 5px → 5px（適切な配置） */
}

.hamburger-icon span:nth-child(2) {
    display: none; /* 2本目を非表示 */
}

.hamburger-icon span:nth-child(3) {
    bottom: 5px; /* 5px → 5px（適切な配置） */
}

/* メニュー開閉時のアニメーション（X形） */
.hamburger.active .hamburger-icon span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger.active .hamburger-icon span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* アイコンに小さなダイヤモンド装飾（学マス風）*/
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    transform: rotate(45deg);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.hamburger-icon::before {
    left: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger-icon::after {
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

/* 開閉時にダイヤモンドを非表示 */
.hamburger.active .hamburger-icon::before,
.hamburger.active .hamburger-icon::after {
    opacity: 0;
    transform: translateY(-50%) rotate(45deg) scale(0);
}


/* 横スライドメニュー */
.slide-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(90, 143, 106, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998; /* ハンバーガーボタンより下 */
}

.slide-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.slide-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 252, 248, 0.98) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: -8px 0 40px rgba(90, 143, 106, 0.12);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999; /* ハンバーガーボタンより下 */
    display: flex;
    flex-direction: column;
}

.slide-menu-overlay.show .slide-menu-panel {
    right: 0;
}

.slide-menu-header {
    display: none; /* ×ボタンを削除したため非表示 */
}

.slide-menu-header h3 {
    display: none; /* 「メニュー」表記を非表示 */
}

.close-slide-menu {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-dark);
}

.close-slide-menu:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.slide-menu-content {
    flex: 1;
    padding: 80px 20px 20px 20px; /* 上部に固定ヘッダーの高さ分のパディングを追加 */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slide-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20.8px 24px;
    margin: 3.2px 0;
    color: #2c3e50;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
}

.slide-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(90, 143, 106, 0.04) 0%, 
        rgba(155, 196, 125, 0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.slide-menu-item:hover::before,
.slide-menu-item:active::before {
    opacity: 1;
}

.slide-menu-item:active {
    transform: translateX(8px);
}

.slide-menu-item .menu-icon {
    width: 48px;
    height: 48px;
    background: var(--light-green);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.slide-menu-item .menu-text {
    flex: 1;
}

.slide-menu-item .menu-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.slide-menu-item .menu-subtitle {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

/* レスポンシブ対応 */
@media (min-width: 768px) {
    .main-header {
        display: block;
    }
    .mobile-header {
        display: none;
    }
    .mobile-menu-btn {
        display: none; /* デスクトップ・タブレット版では非表示 */
    }
}

@media (max-width: 767px) {
    .main-header {
        display: none;
    }
    .mobile-header {
        display: block;
    }
    .mobile-menu-btn {
        display: flex; /* モバイル版では表示 */
    }
    
    /* 固定ヘッダーの高さ分、bodyにパディングを追加（より大きく） */
    body {
        padding-top: 100px; /* 80px → 100px に増加 */
    }
    
    /* コンテンツラッパーの位置も調整（より大きく） */
    .content-wrapper {
        margin-top: 30px; /* 20px → 30px に増加 */
    }
    
    /* スライドメニューのコンテンツ位置を調整 */
    .slide-menu-content {
        padding-top: 100px; /* 80px → 100px に増加 */
    }
    
    /* メニューセクションの上部マージンを調整（より大きく） */
    .menu-section {
        margin-top: 15px; /* 10px → 15px に増加 */
    }
    
    /* 最初のセクションの上部マージンを追加（より大きく） */
    .menu-section:first-child {
        margin-top: 30px; /* 20px → 30px に増加 */
    }
    
    /* メインコンテンツ全体を下げる */
    main {
        margin-top: 20px; /* メインコンテンツ全体を下げる */
    }
    
    /* セクションヘッダーの上部マージンも追加 */
    .section-header {
        margin-top: 10px;
    }
}

/* メニューボタンのレスポンシブ対応 */
@media (min-width: 480px) {
    .mobile-menu-btn {
        width: 150px; /* 160px → 150px（さらに横幅を調整） */
        height: 50px; /* 縦幅は維持（押しやすさを保持） */
        font-size: 13px;
        padding: 0 20px; /* 24px → 20px（パディングをさらに調整） */
    }
    
    .hamburger-icon {
        width: 28px; /* 32px → 28px（少し小さく） */
        height: 22px; /* 26px → 22px（少し小さく） */
    }
    
    .hamburger-icon span {
        height: 3.5px; /* 4.5px → 3.5px（少し細く） */
    }
}

@media (max-width: 480px) {
    .mobile-menu-btn {
        width: 130px; /* 140px → 130px（さらに横幅を調整） */
        height: 46px; /* 縦幅は維持（押しやすさを保持） */
        font-size: 12px;
        padding: 0 18px; /* 20px → 18px（パディングをさらに調整） */
    }
    
    .hamburger-icon {
        width: 26px; /* 30px → 26px（少し小さく） */
        height: 20px; /* 24px → 20px（少し小さく） */
    }
    
    .hamburger-icon span {
        height: 3px; /* 4px → 3px（少し細く） */
    }
    
    /* 小さな画面での調整（より大きく） */
    body {
        padding-top: 90px; /* 70px → 90px に増加 */
    }
    
    .slide-menu-content {
        padding-top: 90px; /* 70px → 90px に増加 */
    }
    
    .content-wrapper {
        margin-top: 25px; /* 15px → 25px に増加 */
    }
    
    /* メインコンテンツ全体を下げる */
    main {
        margin-top: 15px; /* 少し狭く */
    }
    
    /* 施術内容リストのレスポンシブ対応 */
    .receipt-item {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        padding: 12px 12px 12px 6px; /* 左パディングを6pxに */
    }
    
    .item-price {
        min-width: 70px;
        font-size: 16px;
    }
    
    .remove-btn {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

@media (max-width: 375px) {
    .mobile-menu-btn {
        width: 120px; /* 130px → 120px（さらに横幅を調整） */
        height: 44px; /* 縦幅は維持（押しやすさを保持） */
        font-size: 11px;
        padding: 0 16px; /* 18px → 16px（パディングをさらに調整） */
    }
    
    .hamburger-icon {
        width: 24px; /* 28px → 24px（少し小さく） */
        height: 18px; /* 22px → 18px（少し小さく） */
    }
    
    .hamburger-icon span {
        height: 2.5px; /* 3.5px → 2.5px（少し細く） */
    }
    
    /* 最小画面での調整（より大きく） */
    body {
        padding-top: 85px; /* 65px → 85px に増加 */
    }
    
    .slide-menu-content {
        padding-top: 85px; /* 65px → 85px に増加 */
    }
    
    .content-wrapper {
        margin-top: 20px; /* 10px → 20px に増加 */
    }
    
    .menu-section:first-child {
        margin-top: 25px; /* 15px → 25px に増加 */
    }
    
    /* メインコンテンツ全体を下げる */
    main {
        margin-top: 10px; /* さらに狭く */
    }
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 28px;
    align-items: start;
}

main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.menu-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.menu-section:hover {
    box-shadow: var(--shadow-medium);
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--soft-green);
}

.section-header h2 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--primary-green);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

.info-note {
    font-size: 13px;
    color: var(--primary-green);
    background: var(--pale-green);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 3px solid var(--light-green);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.menu-btn {
    background: var(--bg-cream);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 22px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--light-green);
    transform: scaleY(0);
    transition: var(--transition);
}

.menu-btn:hover {
    background: var(--bg-white);
    border-color: var(--soft-green);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.menu-btn:hover::before {
    transform: scaleY(1);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn.selected {
    background: linear-gradient(135deg, var(--light-green) 0%, var(--primary-green) 100%);
    border-color: var(--primary-green);
    box-shadow: var(--shadow-medium);
}

.menu-btn.selected::before {
    transform: scaleY(1);
    background: var(--primary-green);
}

.menu-btn.selected .menu-name,
.menu-btn.selected .menu-price,
.menu-btn.selected small {
    color: var(--bg-white);
}

/* カテゴリ別の色分け */
.menu-btn[data-color-category="cut"] {
    background: var(--bg-cream);
    border-color: var(--cut-color);
}

.menu-btn[data-color-category="cut"]::before {
    background: var(--cut-color);
}

.menu-btn[data-color-category="cut"]:hover {
    background: var(--bg-white);
    border-color: var(--cut-color);
    box-shadow: 0 2px 8px rgba(90, 143, 106, 0.15);
}

.menu-btn[data-color-category="cut"].selected {
    background: linear-gradient(135deg, var(--cut-color) 0%, #4a7a5a 100%);
    border-color: var(--cut-color);
}

.menu-btn[data-color-category="color"] {
    background: var(--bg-cream);
    border-color: var(--color-color);
}

.menu-btn[data-color-category="color"]::before {
    background: var(--color-color);
}

.menu-btn[data-color-category="color"]:hover {
    background: var(--bg-white);
    border-color: var(--color-color);
    box-shadow: 0 2px 8px rgba(122, 159, 138, 0.15);
}

.menu-btn[data-color-category="color"].selected {
    background: linear-gradient(135deg, var(--color-color) 0%, #6a8f7a 100%);
    border-color: var(--color-color);
}

.menu-btn[data-color-category="perm"] {
    background: var(--bg-cream);
    border-color: var(--perm-color);
}

.menu-btn[data-color-category="perm"]::before {
    background: var(--perm-color);
}

.menu-btn[data-color-category="perm"]:hover {
    background: var(--bg-white);
    border-color: var(--perm-color);
    box-shadow: 0 2px 8px rgba(106, 143, 122, 0.15);
}

.menu-btn[data-color-category="perm"].selected {
    background: linear-gradient(135deg, var(--perm-color) 0%, #5a7a6a 100%);
    border-color: var(--perm-color);
}

.menu-btn[data-color-category="other"] {
    background: var(--bg-cream);
    border-color: var(--other-color);
}

.menu-btn[data-color-category="other"]::before {
    background: var(--other-color);
}

.menu-btn[data-color-category="other"]:hover {
    background: var(--bg-white);
    border-color: var(--other-color);
    box-shadow: 0 2px 8px rgba(138, 159, 122, 0.15);
}

.menu-btn[data-color-category="other"].selected {
    background: linear-gradient(135deg, var(--other-color) 0%, #7a8f6a 100%);
    border-color: var(--other-color);
}

.menu-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.5;
}

.menu-name small {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 400;
}

.menu-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-green);
    letter-spacing: -0.3px;
}

.service-note {
    background: linear-gradient(135deg, var(--pale-green) 0%, var(--soft-green) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.service-note .highlight {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-green);
}

.service-note p {
    font-size: 13px;
    color: var(--text-medium);
    margin-bottom: 4px;
}

.receipt {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--soft-green);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.receipt h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--primary-green);
    letter-spacing: -0.3px;
}

.item-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 6px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 240px;
    color: var(--text-light);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--light-green);
}

.empty-state p {
    font-size: 15px;
    color: var(--text-light);
}

.receipt-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 8px;
    margin-bottom: 10px;
    background: var(--pale-green);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--light-green);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 4px rgba(90, 143, 106, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.receipt-item:hover {
    background: var(--soft-green);
    border-left-color: var(--primary-green);
    transform: translateX(2px);
    box-shadow: 0 4px 8px rgba(90, 143, 106, 0.2);
}

/* カテゴリ別の色分け */
.receipt-item[data-category="product"] {
    border-left-color: #4CAF50;
}

.receipt-item[data-category="service"] {
    border-left-color: #2196F3;
}

.receipt-item[data-category="treatment"] {
    border-left-color: #FF9800;
}

.receipt-item[data-category="haircut"] {
    border-left-color: #9C27B0;
}

.receipt-item[data-category="perm"] {
    border-left-color: #E91E63;
}

.receipt-item[data-category="color"] {
    border-left-color: #FF5722;
}

.receipt-item[data-category="offer"] {
    border-left-color: #FFC107;
}


.item-category {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-medium);
    background: rgba(90, 143, 106, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 2px;
}

.item-quantity {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    background: rgba(90, 143, 106, 0.15);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
}

.item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 3px;
    padding-left: 0; /* 左端からスタート */
    margin-left: 0; /* 追加 */
    text-align: left;
}

.item-note {
    font-size: 12px;
    color: var(--text-medium);
    padding-left: 0; /* 左端からスタート */
    margin-left: 0; /* マージンも0に */
}

.cart-status-indicator {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-green);
    background: rgba(90, 143, 106, 0.15);
    padding: 4px 8px;
    border-radius: 12px;
    margin-top: 4px;
    display: inline-block;
    border: 1px solid rgba(90, 143, 106, 0.3);
}

/* 顧客番号表示用のスタイル */
.customer-number-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-green);
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-green);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-btn.selected .customer-number-badge {
    background: var(--primary-green);
    color: white;
    border-color: white;
}

/* 商品リストの顧客番号 */
.product-customer-badge {
    background: var(--primary-green);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    display: inline-block;
}

.item-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-green);
    letter-spacing: -0.3px;
    text-align: right;
    min-width: 80px; /* 最小幅を確保 */
}

.remove-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

.remove-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 71, 87, 0.4);
}

.remove-btn:active {
    transform: scale(0.95);
}

.total-section {
    border-top: 2px solid var(--soft-green);
    padding-top: 20px;
    margin-top: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
}

.total-row.subtotal,
.total-row.tax {
    color: var(--text-medium);
}

.total-row.total {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-green);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--light-green);
    letter-spacing: -0.3px;
}

.clear-btn {
    width: 100%;
    padding: 14px;
    background: var(--pale-green);
    color: var(--primary-green);
    border: 2px solid var(--soft-green);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
}

.clear-btn:hover {
    background: var(--soft-green);
    border-color: var(--light-green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.clear-btn:active {
    transform: translateY(0);
}

.item-list::-webkit-scrollbar {
    width: 6px;
}

.item-list::-webkit-scrollbar-track {
    background: transparent;
}

.item-list::-webkit-scrollbar-thumb {
    background: var(--light-green);
    border-radius: 3px;
}

.item-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

.price-breakdown {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 13px;
}

.original-price {
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-arrow {
    color: var(--light-green);
    font-weight: 600;
}

.discounted-price {
    color: var(--primary-green);
    font-weight: 600;
}

/* ===================================
   お預かり・お釣りセクション
   =================================== */

.payment-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--soft-green);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* お預かり金額ボックス */
.payment-box {
    background: var(--pale-green);
    border: 2px solid var(--soft-green);
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.3s ease;
}

.payment-box:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(155, 196, 125, 0.2);
    background: #fff;
}

.payment-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 12px;
}

/* よく使う金額ボタン */
.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.quick-amount-btn {
    padding: 16px 12px;
    background: #fff;
    border: 2px solid var(--soft-green);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.quick-amount-btn:active {
    transform: scale(0.95);
    background: var(--soft-green);
    border-color: var(--primary-green);
}

/* お預かり金額入力 */
.payment-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 34px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: right;
    outline: none;
    padding: 18px 0;
    min-height: 70px;
}

.payment-input::placeholder {
    color: var(--text-light);
    font-size: 32px;
    font-weight: 600;
}

/* 数値入力の矢印ボタンを非表示 */
.payment-input::-webkit-outer-spin-button,
.payment-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.payment-input[type="number"] {
    -moz-appearance: textfield;
}

/* お釣りボックス */
.change-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
}

.change-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.change-amount {
    font-size: 32px;
    color: var(--primary-green);
    font-weight: 700;
}

.change-amount.insufficient {
    color: #f44336;
}

/* ===================================
   商品バーコードスキャナー
   =================================== */

/* スキャナーエリア（モバイル対応） */
#scannerArea {
  max-width: 100% !important;
  max-height: 400px !important;
  aspect-ratio: 16/9 !important;
  margin: 16px auto !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
}

#scannerVideo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 12px !important;
}

/* モバイル用レスポンシブ */
@media (max-width: 768px) {
  #scannerArea {
    max-height: 300px !important;
    margin: 12px auto !important;
  }
}

@media (max-width: 480px) {
  #scannerArea {
    max-height: 250px !important;
    margin: 8px auto !important;
  }
}

/* スキャン用ROIガイド枠（コーナーマーカーのみ） */
.scanner-roi {
  position: absolute;
  width: 85%; /* 65% -> 85% より広い範囲でスキャン */
  aspect-ratio: 3/1; /* 4/3 -> 3/1 バーコード用の横長 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.2); /* より濃いオーバーレイ */
  pointer-events: none;
  animation: scannerPulse 2s ease-in-out infinite;
}

/* 4つのコーナーマーカー */
.corner-marker {
  position: absolute;
  width: 30px; /* 20px -> 30px より大きく */
  height: 30px; /* 20px -> 30px より大きく */
  border: 4px solid var(--light-green); /* 3px -> 4px より太く */
}

.corner-marker.top-left {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-radius: 4px 0 0 0;
}

.corner-marker.top-right {
  top: -3px;
  right: -3px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 4px 0 0;
}

.corner-marker.bottom-left {
  bottom: -3px;
  left: -3px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 4px;
}

.corner-marker.bottom-right {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 4px 0;
}

/* スキャン中のアニメーション */
.scanner-roi.scanning {
  animation: scanLine 1.5s linear infinite;
}

/* パルスアニメーション */
@keyframes scannerPulse {
  0%, 100% { 
    border-color: var(--light-green);
    box-shadow: 
      0 0 0 9999px rgba(0, 0, 0, 0.1),
      0 0 20px rgba(155, 196, 125, 0.3),
      inset 0 0 20px rgba(155, 196, 125, 0.1);
  }
  50% { 
    border-color: var(--primary-green);
    box-shadow: 
      0 0 0 9999px rgba(0, 0, 0, 0.1),
      0 0 30px rgba(90, 143, 106, 0.5),
      inset 0 0 30px rgba(90, 143, 106, 0.2);
  }
}

/* スキャンラインアニメーション */
@keyframes scanLine {
  0% { 
    background: linear-gradient(90deg, transparent 0%, rgba(155, 196, 125, 0.3) 50%, transparent 100%);
    background-position: -100% 0;
  }
  100% { 
    background-position: 100% 0;
  }
}

/* モバイル用レスポンシブ */
@media (max-width: 768px) {
  .scanner-roi {
    width: 90%; /* より広い範囲でスキャン */
    aspect-ratio: 2.5/1; /* バーコード用の横長 */
  }
  
  .corner-marker {
    width: 35px; /* モバイルでより大きく */
    height: 35px;
    border: 5px solid var(--light-green); /* より太く */
  }
}

@media (min-width: 768px) {
  .scanner-roi {
    width: 70%; /* デスクトップでも横長に最適化 */
    aspect-ratio: 3/1; /* バーコード用 */
  }
}

/* ===================================
   Products専用スタイル
=================================== */

/* Productsセクション全体を目立たせる */
.products-section {
    background: var(--bg-white); /* 白に変更 */
    border: 2px solid var(--light-green);
    box-shadow: 0 4px 20px rgba(90, 143, 106, 0.15);
}

.products-section:hover {
    box-shadow: 0 6px 28px rgba(90, 143, 106, 0.22);
}

.products-section .section-header {
    border-bottom-color: var(--light-green);
}

.products-section .section-header h2 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* バーコードスキャナーボタン（メインアクション） */
.scanner-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(90, 143, 106, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.scanner-btn svg {
    flex-shrink: 0;
}

.scanner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(90, 143, 106, 0.4);
}

.scanner-btn:active {
    transform: translateY(0);
}

.scanner-btn.active {
    background: linear-gradient(135deg, #ef5350, #ff7043);
}

/* 商品リスト表示ボタン（改善版） */
.toggle-products-btn.modern {
    width: 100%;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--soft-green);
    border-radius: 12px;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(90, 143, 106, 0.08);
}

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


.toggle-content svg {
    color: var(--primary-green);
}

.toggle-products-btn.modern:hover {
    background: var(--pale-green);
    border-color: var(--light-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 143, 106, 0.15);
}

.toggle-products-btn.modern.active {
    background: var(--light-green);
    border-color: var(--primary-green);
    color: white;
}

.toggle-products-btn.modern.active svg {
    color: white;
}

.toggle-icon {
    display: none;
}

.toggle-products-btn.active .toggle-icon {
    transform: rotate(180deg);
}

/* 商品グリッド（折りたたみ）
#productGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
} */

/* .product-grid-collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
} */

/* .product-grid-expanded {
    max-height: 60vh;      
    overflow-y: auto;      
    opacity: 1;
    margin-bottom: 16px;
} */

/* 商品ボタン専用スタイル */
#productGrid .menu-btn {
    background: white;
    border: 2px solid var(--soft-green);
    padding: 18px 16px;
    transition: all 0.3s ease;
}

#productGrid .menu-btn:hover {
    background: var(--pale-green);
    border-color: var(--light-green);
    box-shadow: 0 4px 12px rgba(90, 143, 106, 0.2);
}

#productGrid .menu-btn .menu-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

#productGrid .menu-btn .menu-item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-green);
}


.product-modal-grid {
  max-height: calc(85vh - 180px);
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;

  overscroll-behavior: contain;
  
  /* スクロールバーをカスタマイズ（Webkit系ブラウザ） */
  scrollbar-width: thin;
  scrollbar-color: var(--light-green) transparent;
}

.product-modal-grid::-webkit-scrollbar {
  width: 8px;
}

.product-modal-grid::-webkit-scrollbar-track {
  background: transparent;
}

.product-modal-grid::-webkit-scrollbar-thumb {
  background: var(--light-green);
  border-radius: 4px;
}

#closeProductDialogBtn {
  width: 100%;
  padding: 16px;
  background: var(--light-green);
  color: white;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  border-top: 1px solid var(--border-light);
}

#closeProductDialogBtn:hover {
  background: var(--primary-green);
}

#closeProductDialogBtn:active {
  transform: scale(0.98);
}

.product-modal-grid .menu-btn {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  transition: all 0.2s ease;
}

.product-modal-grid .menu-btn:hover {
  background: var(--pale-green);
  border-color: var(--light-green);
}

.product-modal-grid .menu-btn:active {
  transform: scale(0.97);
}



/* スキャン成功アニメーション */
.menu-btn.scanned {
    animation: scanSuccess 0.5s ease;
}

@keyframes scanSuccess {
    0%, 100% {
        transform: scale(1);
        background: white;
        border-color: var(--soft-green);
    }
    50% {
        transform: scale(1.08);
        background: var(--light-green);
        border-color: var(--primary-green);
    }
}


.history-btn {
  width: 100%;
  padding: 14px;
  background: var(--pale-green);
  color: var(--primary-green);
  border: 2px solid var(--soft-green);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 12px; /* クリアボタンとの間隔 */
}
.history-btn:hover {
  background: var(--soft-green);
  border-color: var(--light-green);
  box-shadow: var(--shadow-soft);
}

/* ==========================================
   会計確定・履歴表示ボタン + モーダル
   ========================================== */

/* 会計確定ボタン */
.main-action-btn {
  width: 100%;
  padding: 16px 0;
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  margin-top: 18px;
  transition: all 0.2s ease;
}

.main-action-btn:hover {
  background: linear-gradient(135deg, var(--primary-green) 80%, var(--soft-green));
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

/* 履歴表示ボタン */
.secondary-action-btn {
  width: 100%;
  padding: 13px 0;
  background: var(--pale-green);
  color: var(--primary-green);
  border: 2px solid var(--soft-green);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-action-btn:hover {
  background: var(--light-green);
  color: white;
  border-color: var(--primary-green);
}

/* モーダル背景オーバーレイ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

/* 履歴モーダル */
.history-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 32px 28px 24px 28px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 11000;
  animation: fadeInScale 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInScale {
  from { 
    opacity: 0; 
    transform: translate(-50%, -60%) scale(0.9);
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1);
  }
}

.history-modal h2 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-green);
  letter-spacing: -0.3px;
  text-align: center;
}

.history-modal ul {
  margin-bottom: 20px;
  padding-left: 0;
  list-style: none;
}

.history-modal li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-dark);
}

.history-modal li:last-child {
  border-bottom: none;
}

.history-modal li button {
  margin-left: 12px;
  padding: 6px 14px;
  background: var(--pale-green);
  color: var(--primary-green);
  border: 2px solid var(--soft-green);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-modal li button:hover {
  background: #ffebee;
  color: #c62828;
  border-color: #ef5350;
}

.history-modal > button {
  width: 100%;
  margin-top: 16px;
  font-size: 16px;
  padding: 12px 0;
  background: var(--light-green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-modal > button:hover {
  background: var(--primary-green);
}

/* 履歴詳細表示 */
.history-list {
  margin-bottom: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.history-item {
  background: var(--pale-green);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--soft-green);
}

.history-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-green);
}

.history-delete-btn {
  padding: 6px 14px;
  background: white;
  color: #c62828;
  border: 2px solid #ef5350;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-delete-btn:hover {
  background: #ffebee;
  border-color: #c62828;
}

.history-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-items {
  background: white;
  padding: 12px;
  border-radius: 8px;
}

.history-item-row {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

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

.history-summary {
  background: white;
  padding: 12px;
  border-radius: 8px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dark);
}

.history-row.highlight {
  font-weight: 700;
  color: var(--primary-green);
  font-size: 16px;
  padding-top: 10px;
  border-top: 2px solid var(--soft-green);
}

/* ===================================
   過去履歴モーダル
   =================================== */

.weekly-history-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 0;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  z-index: 11000;
  animation: fadeInScale 0.25s ease;
}

.weekly-history-modal .modal-header {
  background: var(--primary-green);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weekly-history-modal .modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.weekly-history-modal .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.weekly-history-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.weekly-history-modal .modal-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.empty-history {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-history .empty-icon {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-history h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text-dark);
}

.empty-history p {
  margin: 0;
  font-size: 14px;
}

.weekly-history-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.date-header-ios {
  background: linear-gradient(135deg, #5a8f6a 0%, #9bc47d 100%);
  color: white;
  padding: 20px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.date-title-ios {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.date-stats-ios {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.count-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.total-amount {
  font-size: 20px;
  font-weight: 700;
}

.receipts-list {
  flex: 1;
  overflow-y: auto;
  max-height: none; /* 制限を解除 */
  background: transparent;
  padding: 0;
}

.receipt-card-ios {
  background: var(--pale-green);
  border-radius: 12px;
  margin-bottom: 6px;
  margin-left: 0;
  margin-right: 0;
  box-shadow: 0 2px 4px rgba(90, 143, 106, 0.1);
  border: 1px solid var(--soft-green);
  overflow: hidden;
}

.card-content {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  gap: 12px;
}

.receipt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-badge {
  background: var(--soft-green);
  color: var(--primary-green);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
  align-self: flex-start;
}

.item-info {
  flex: 1;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.3;
  word-wrap: break-word;
}

.item-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-green);
  text-align: left;
}


.item-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 16px;
}

.item-row .item-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0;
  line-height: 1.3;
  word-wrap: break-word;
}

.item-row .item-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-green);
  text-align: left;
  align-self: flex-start;
}

.receipt-divider {
  height: 1px;
  background: var(--soft-green);
  margin: 12px 0;
}



.total-row {
  font-weight: 700;
  padding-top: 6px;
  border-top: 1px solid var(--soft-green);
}

.delete-btn-ios {
  background: var(--soft-green);
  border: 1px solid var(--primary-green);
  border-radius: 8px;
  padding: 12px;
  color: var(--primary-green);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.delete-btn-ios:active {
  transform: scale(0.95);
  background: var(--primary-green);
  color: white;
}

/* ===================================
   キーボードバーコードスキャン用
   =================================== */

/* スキャンエラー通知 */
.scan-error-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef5350;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 12000;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* バーコードスキャン時のアニメーション */
.menu-btn.scanned {
  animation: scanPulse 0.3s ease;
}

@keyframes scanPulse {
  0%, 100% { 
    transform: scale(1);
    background: var(--bg-white);
  }
  50% { 
    transform: scale(1.05);
    background: var(--soft-green);
  }
}

/* レジ締めボタン専用 */
.report-action-btn {
  width: 100%;
  padding: 15px 0;
  background: linear-gradient(135deg, #4caf50, #8bc34a) !important;
  color: white !important;
  border: none !important;
  border-radius: 14px;
  font-size: 17px !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s ease;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.report-action-btn:hover {
  background: linear-gradient(135deg, #43a047, #7cb342);
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

.report-action-btn:active {
  transform: translateY(0);
}

/* レスポンシブ対応: 小さな画面での調整 */
@media (max-height: 800px) {
  .daily-report-modal {
    max-height: 65vh;
    height: 65vh;
  }
  
  .daily-report-content {
    max-height: calc(65vh - 120px);
  }
}

@media (max-height: 600px) {
  .daily-report-modal {
    max-height: 70vh;
    height: 70vh;
  }
  
  .daily-report-content {
    max-height: calc(70vh - 120px);
  }
}

/* ===================================
   1日集計レポート
   =================================== */

.daily-report-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 0;
  min-width: 320px;
  max-width: 95vw;
  max-height: 85vh;
  overflow: hidden;
  z-index: 11000;
  animation: fadeInScale 0.25s ease;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 auto;
  align-items: stretch;
}

.daily-report-content {
  padding: 12px 20px;
  height: auto;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
  flex: none !important;
  display: block !important;
  position: relative;
}

/* .daily-report-modal h2 ルールを削除 - .daily-report-header h2 で制御 */

.daily-report-header {
  background: var(--primary-green);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daily-report-header h2 {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  flex: 1 !important;
  text-align: center !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: white !important;
}

.daily-report-header .close-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  color: white !important;
  font-size: 28px !important;
  cursor: pointer !important;
  padding: 6px !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: -2px !important;
  transform: translateY(-1px) !important;
}

.daily-report-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-1px) scale(1.1) !important;
}

.daily-report-footer {
  flex-shrink: 0; /* 固定サイズ */
  padding: 8px 12px 16px 12px; /* 左右のパディングを20px→12pxに減らす */
  background: white;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
  margin-top: auto;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
  margin-top: 0;
  position: relative;
  top: 0;
}

.report-card {
  background: var(--pale-green);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  border: 2px solid var(--soft-green);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-card.highlight {
  background: linear-gradient(135deg, var(--light-green), var(--primary-green));
  border-color: var(--primary-green);
}

.report-card.highlight .report-label,
.report-card.highlight .report-value {
  color: white;
}

.report-label {
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 600;
  margin-bottom: 8px;
}

.report-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-green);
  letter-spacing: -0.5px;
}

.report-value .unit {
  font-size: 16px;
  margin-left: 4px;
  font-weight: 600;
}

.report-details {
  margin-top: 24px;
}

.report-details h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 16px;
}

.report-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-item {
  background: var(--pale-green);
  border-radius: 10px;
  padding: 14px;
  border-left: 4px solid var(--light-green);
}

.report-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-green);
}

.report-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
}

.report-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-green);
}

.report-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dark);
}

.empty-report {
  padding: 16px 20px !important;
  color: var(--text-light);
  margin-top: 0;
  font-size: 14px;
  line-height: 1.4;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #f9f9f9 !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 12px !important;
  margin: 10px 0 !important;
  position: relative;
  top: 0;
  min-height: 50px !important;
}

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

.close-report-btn,
.clear-today-btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-report-btn {
  background: var(--pale-green);
  color: var(--primary-green);
  border: 2px solid var(--soft-green);
  width: calc(100% - 24px); /* パディング分を引いた全幅 */
  margin: 0 auto; /* 中央揃え */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 2 !important;
}

.close-report-btn:hover {
  background: var(--soft-green);
}

.clear-today-btn {
  background: #ffebee;
  color: #c62828;
  border: 2px solid #ef5350;
}

.clear-today-btn:hover {
  background: #ef5350;
  color: white;
}



/* ===================================
   レスポンシブデザイン
   =================================== */

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .receipt {
        position: static;
        max-height: none;
    }
}

/* デスクトップ版のサイドバー修正 */
@media (min-width: 768px) {
  .receipt {
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    padding-bottom: 3rem;
  }
  
  .payment-section {
    margin-bottom: 2rem;
  }
}


@media (max-width: 768px) {
    /* モバイルズーム防止の強化設定 */
    html {
        -webkit-text-size-adjust: 100%;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }
    
    input, textarea, button, .menu-btn, .product-search-input {
        -webkit-text-size-adjust: 100%;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .logo {
        max-width: 220px;
    }

    .payment-section {
        gap: 14px;
    }
    
    .payment-box,
    .change-box {
        padding: 18px 20px;
    }
    
    .payment-label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .quick-amount-btn {
        padding: 14px 10px;
        font-size: 15px;
    }
    
    .payment-input {
        font-size: 32px;
        padding: 16px 0;
        min-height: 64px;
    }
    
    .payment-input::placeholder {
        font-size: 32px;
    }
    
    .change-label {
        font-size: 16px;
    }
    
    .change-amount {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    header {
        padding: 32px 20px 20px;
        margin-bottom: 32px;
    }
    
    .logo {
        max-width: 180px;
    }

    .menu-section {
        padding: 24px;
    }

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

    .receipt {
        padding: 24px;
    }

    #productGrid {
        grid-template-columns: 1fr;
    }

    .scanner-btn {
        padding: 16px 20px;
        font-size: 16px;
    }

    .toggle-products-btn.modern {
        padding: 14px 18px;
        font-size: 15px;
    }

    #productGrid {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .report-value {
        font-size: 24px;
    }
    
    .report-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .payment-section {
        gap: 12px;
    }
    
    .payment-box,
    .change-box {
        padding: 16px 18px;
    }
    
    .payment-label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .quick-amount-btn {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .payment-input {
        font-size: 28px;
        padding: 14px 0;
        min-height: 56px;
    }
    
    .payment-input::placeholder {
        font-size: 28px;
    }
    
    .change-label {
        font-size: 15px;
    }
    
    .change-amount {
        font-size: 24px;
    }
}

/* ===================================
   ログイン画面スタイル
   =================================== */

/* ログイン画面全体 */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--pale-green) 0%, #f0f8f0 100%);
}

/* ログインヘッダー */
.login-header {
    padding: 30px 20px 5px 20px; /* 上部パディングをさらに増加、下部をさらに減少 */
    text-align: center;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* ロゴを下部に配置 */
    min-height: 120px; /* 最小高さを設定してロゴの位置を下げる */
}

/* ログイン画面ロゴ */
.login-logo {
    display: block;
    margin: 0 auto;
    height: 70px;
    width: auto;
    max-width: 220px;
    filter: none;
    transition: filter 0.3s ease;
}

/* ログインコンテンツ */
.login-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* center → flex-start に変更 */
    padding: 20px 20px; /* 0px → 20px に変更して上部にマージンを追加 */
}

.login-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* 60vh → 100vh に変更 */
    padding: 20px;
}

.login-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--soft-green);
    width: 100%;
    max-width: 400px;
    margin-top: 10vh; /* 上部からの距離を指定 */
    text-align: center;
}

.login-container h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(155, 196, 125, 0.2);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid #ef5350;
    text-align: left;
}

.login-btn {
    width: 100%;
    padding: 18px 0;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-green) 80%, var(--soft-green));
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* セキュリティ情報 */
.security-info {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--soft-green);
}

.security-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-medium);
}

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

.security-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ログイン画面のレスポンシブ */
@media (max-width: 640px) {
    .login-header {
        padding: 40px 16px 5px 16px; /* 25px → 40px にさらに増加 */
        min-height: 150px; /* 100px → 150px に大幅増加 */
    }
    
    .login-logo {
        height: 80px; /* 60px → 80px に大幅拡大 */
        max-width: 200px; /* 160px → 200px に拡大 */
    }
    
    .login-content {
        padding: 10px 16px; /* 上部パディングを追加 */
    }
    
    .login-container {
        padding: 32px 24px;
        margin-top: 5vh; /* モバイルでは少し上に */
    }
    
    .login-container h2 {
        font-size: 22px;
    }
    
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .login-form {
        gap: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .login-btn {
        padding: 16px 0;
        font-size: 15px;
        min-height: 48px;
    }
    
    .header-actions {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .login-header {
        min-height: 130px; /* 90px → 130px に大幅増加 */
    }
    
    .login-logo {
        height: 70px; /* 55px → 70px に大幅拡大 */
        max-width: 180px; /* 140px → 180px に拡大 */
    }
    
    .login-container {
        padding: 28px 20px;
        margin-top: 3vh; /* さらに小さな画面では少し上に */
    }
    
    .login-container h2 {
        font-size: 20px;
    }
    
    .login-subtitle {
        font-size: 12px;
        margin-bottom: 18px;
    }
}

/* デスクトップモードでのログイン画面配置改善 */
@media (min-width: 768px) {
    .login-main {
        min-height: 100vh;
        padding: 20px 40px; /* 左右のパディングを増加 */
    }
    
    .login-container {
        padding: 48px 40px; /* パディングを調整 */
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* ロゴとフォームの間のマージンを調整 */
    .login-container h2 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 24px; /* マージンを削減 */
    }
    
    .login-form {
        gap: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .login-btn {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 50px;
    }
}

@media (min-width: 1024px) {
    .login-main {
        padding: 20px 60px;
    }
    
    .login-container {
        padding: 56px 48px;
        max-width: 420px;
    }
    
    .login-container h2 {
        font-size: 32px;
        margin-bottom: 12px;
    }
    
    .login-subtitle {
        font-size: 16px;
        margin-bottom: 28px;
    }
    
    .login-form {
        gap: 24px;
    }
    
    .form-group {
        margin-bottom: 24px;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .form-group input {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .login-btn {
        padding: 18px 32px;
        font-size: 18px;
        min-height: 56px;
    }
    
    .logout-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ===================================
   複数顧客管理
   =================================== */

.customer-list {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--soft-green);
}

.customer-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.customer-list-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-green);
    margin: 0;
}

.add-customer-btn {
    background: var(--light-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-customer-btn:hover {
    background: var(--primary-green);
    transform: translateY(-1px);
}

.customer-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.customer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--pale-green);
    border: 2px solid var(--soft-green);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.customer-item:hover {
    background: var(--soft-green);
    border-color: var(--light-green);
}

.customer-item.active {
    background: var(--light-green);
    border-color: var(--primary-green);
    color: white;
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.customer-items-count {
    font-size: 12px;
    opacity: 0.8;
}

.remove-customer-btn {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-customer-btn:hover {
    background: #ef5350;
    color: white;
}

.add-customer-input {
    margin-top: 8px;
}

.add-customer-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-white);
    transition: var(--transition);
}

.add-customer-input input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(155, 196, 125, 0.2);
}


.current-customer-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--soft-green);
}

.current-customer-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    margin: 0;
}

/* 統合内訳表示 */
.summary-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light-green);
}

.summary-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0;
    text-align: center;
}

.customer-summary {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.customer-summary-header {
    background: var(--pale-green);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.customer-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.customer-summary-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
}

.customer-summary-details {
    padding: 12px 16px;
}

.customer-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.customer-summary-items {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.customer-summary-service {
    display: flex;
    font-size: 12px;
    color: var(--text-dark);
    margin-bottom: 4px;
    padding-left: 0; /* 8px → 0に変更 */
    align-items: center;
    text-align: left; /* 追加：テキストを左揃えに */
}

.customer-summary-service:before {
    content: "•";
    margin-right: 4px; /* 0 → 4pxに変更：点とテキストの間に少しスペース */
    margin-left: 0; /* 追加：左マージンを0に */
    color: var(--light-green);
    flex-shrink: 0; /* 追加：疑似要素のサイズを固定 */
    order: -1; /* 追加：疑似要素を最初に配置 */
}

/* 金額部分を右端に配置 */
.customer-summary-service span:last-child {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary-green);
}

.current-customer-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--soft-green);
}

.empty-customer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* ===================================
   商品検索バー
   =================================== */

.product-search-container {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-medium);
    z-index: 1;
    pointer-events: none;
}

.product-search-input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px; /* 14px → 16px に変更（ズーム防止） */
    background: var(--bg-white);
    color: var(--text-dark);
    transition: var(--transition);
    box-sizing: border-box;
    /* モバイルズーム防止の追加設定 */
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.product-search-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(155, 196, 125, 0.1);
}

.product-search-input::placeholder {
    color: var(--text-light);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    background: var(--pale-green);
    color: var(--text-dark);
}

.search-results-info {
    font-size: 12px;
    color: var(--text-medium);
    text-align: right;
    margin-top: 4px;
}

.search-results-info.highlight {
    color: var(--primary-green);
    font-weight: 600;
}

/* 検索結果が0件の場合のスタイル */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--soft-green);
    max-height: 400px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--pale-green);
    border: 2px solid var(--soft-green);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.product-item:hover {
    background: var(--soft-green);
    border-color: var(--light-green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.product-info {
    flex: 1;
    margin-right: 16px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border-light);
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--light-green);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    outline: none;
}

.quantity-btn:hover {
    background: var(--primary-green);
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-display {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.add-to-cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
    justify-content: center;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--light-green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.add-to-cart-btn:active:not(:disabled) {
    transform: translateY(0);
}

.add-to-cart-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.add-to-cart-btn.success {
    background: #4caf50;
    animation: successPulse 0.3s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .product-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .product-info {
        margin-right: 0;
        text-align: center;
    }
    
    .product-controls {
        justify-content: center;
    }
}

.item-quantity {
    background: var(--light-green);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ===================================
   商品モーダル（改善版）
   =================================== */

#productDialog {
    width: 90%;
    max-width: 900px;
    max-height: 95vh;
    border: none;
    border-radius: 16px;
    padding: 0;
    background: var(--bg-white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    
    /* 中央配置のための追加スタイル */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

#productDialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

#productDialog .modal-header {
    position: relative;
    text-align: center;
    padding: 20px;
    background: var(--light-green);
    border-bottom: 1px solid var(--border-light);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

#productDialog .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 手動追加ボタン */
#productDialog .add-manual-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

#productDialog .add-manual-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.05);
}

#productDialog .add-manual-btn:focus {
    outline: none;
}

#productDialog .add-manual-btn:active {
    transform: translateY(-50%) scale(0.95);
}

#productDialog .close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    z-index: 10;
}

#productDialog .close-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

#productDialog .close-btn:active {
    opacity: 0.5;
}

.product-modal-grid::-webkit-scrollbar {
    width: 6px;
}

.product-modal-grid::-webkit-scrollbar-track {
    background: var(--pale-green);
    border-radius: 3px;
}

.product-modal-grid::-webkit-scrollbar-thumb {
    background: var(--light-green);
    border-radius: 3px;
}

.product-modal-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

.product-modal-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-modal-item:hover {
    border-color: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 196, 125, 0.15);
}

.product-modal-info {
    text-align: center;
}

.product-modal-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
}

.product-modal-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.product-modal-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pale-green);
    border-radius: 8px;
    padding: 6px;
    border: 1px solid var(--border-light);
}

.product-modal-quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light-green);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(155, 196, 125, 0.2);
    outline: none;
}

.product-modal-quantity-btn:hover {
    background: var(--primary-green);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(155, 196, 125, 0.3);
}

.product-modal-quantity-btn:focus {
    outline: none;
}

.product-modal-quantity-btn:active {
    transform: scale(0.95);
}

.product-modal-quantity-display {
    min-width: 32px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.product-modal-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(155, 196, 125, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-modal-add-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--light-green) 0%, var(--primary-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 196, 125, 0.4);
}

.product-modal-add-btn:active:not(:disabled) {
    transform: translateY(0);
}

.product-modal-add-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.product-modal-add-btn.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    animation: successPulse 0.4s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* タブレット版（768px以上） */
@media (min-width: 768px) {
    #productDialog {
        width: 80%;
        max-width: 800px;
        /* 中央配置は維持 */
    }
}

/* デスクトップ版（1024px以上） */
@media (min-width: 1024px) {
    #productDialog {
        width: 70%;
        max-width: 700px;
        /* 中央配置は維持 */
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #productDialog {
        width: 95%;
        max-height: 98vh;
        border-radius: 12px;
    }
    
    #productDialog .modal-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .close-btn {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
        font-size: 18px;
        border: none;
    }
    
    .product-modal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
        max-height: calc(90vh - 160px);
        /* Safariの検索バー対策 */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .product-modal-item {
        padding: 16px;
        gap: 12px;
    }
    
    .product-modal-name {
        font-size: 15px;
        min-height: 40px;
    }
    
    .product-modal-price {
        font-size: 18px;
    }
    
    .product-modal-controls {
        gap: 12px;
    }
    
    .product-modal-quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .product-modal-add-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    #productDialog {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        /* モバイルでは全画面表示 */
        top: 0;
        left: 0;
        transform: none;
    }
    
    #productDialog .modal-header {
        border-radius: 0;
    }
    
    .product-modal-grid {
        max-height: calc(100vh - 200px);
        /* モバイルブラウザのUIを考慮した安全な高さ */
        /* Safariの検索バー対策 */
        padding: 8px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

/* ===================================
   エラーハンドリング・ローディング
   =================================== */

.menu-error {
    background: #ffebee;
    border: 2px solid #ef5350;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.menu-error .error-message {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 16px;
}

.menu-error .error-message p {
    color: #c62828;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.menu-error button {
    background: #ef5350;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.menu-error button:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* ローディングスピナー */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   日次締め作業機能
   =================================== */

/* 締め作業ボタン */
.daily-closing-btn {
    padding: 12px 20px;
    background: var(--bg-white);
    color: var(--primary-green);
    border: 2px solid var(--light-green);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(155, 196, 125, 0.2);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-closing-btn:hover {
    background: var(--pale-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 196, 125, 0.3);
}

.daily-closing-btn:active {
    transform: translateY(0);
}

.daily-closing-btn svg {
    width: 20px;
    height: 20px;
}

/* ログアウトボタン */
.logout-btn {
    padding: 12px 20px;
    background: var(--bg-white);
    color: var(--primary-green);
    border: 2px solid var(--light-green);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(155, 196, 125, 0.2);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: var(--pale-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 196, 125, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* 締め作業モーダル */
.daily-closing-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    overflow: hidden;
}

.daily-closing-modal .modal-header {
    background: var(--light-green);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.daily-closing-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-align: center;
}

.daily-closing-modal .close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.daily-closing-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.daily-closing-modal .modal-content {
    padding: 24px;
    padding-bottom: 140px; /* ブラウザナビゲーションバー分の余白を追加 */
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* 締め作業オプション */
.closing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.option-card {
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.option-card:hover {
    border-color: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 196, 125, 0.15);
}

.option-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--pale-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
}

.option-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.option-card p {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

.option-btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.option-btn.primary {
    background: var(--primary-green);
    color: white;
}

.option-btn.primary:hover {
    background: var(--dark-green);
    transform: translateY(-1px);
}

.option-btn.danger {
    background: #ef5350;
    color: white;
}

.option-btn.danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* 注意事項 */
.closing-info {
    background: var(--pale-green);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--primary-green);
    margin-bottom: 120px; /* ブラウザナビゲーションバー分の余白を追加 */
}

.closing-info h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.closing-info ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.closing-info li {
    margin-bottom: 4px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .closing-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .daily-closing-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .daily-closing-modal .modal-content {
        padding: 20px;
        padding-bottom: 140px; /* モバイルでもブラウザナビゲーションバー分の余白を追加 */
    }
    
    .option-card {
        padding: 20px;
    }
    
    .daily-closing-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
        margin-right: 8px;
    }
    
    .daily-closing-btn span {
        display: none;
    }
    
    .daily-closing-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .logout-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .daily-closing-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .daily-closing-modal .modal-header {
        border-radius: 0;
    }
    
    .daily-closing-modal .modal-content {
        max-height: calc(100vh - 80px);
        padding-bottom: 140px; /* 小さな画面でもブラウザナビゲーションバー分の余白を追加 */
    }
}

/* ===================================
   一時商品追加モーダル
   =================================== */

.temp-product-modal {
    width: 90%;
    max-width: 400px;
    border: none;
    border-radius: 16px;
    padding: 0;
    background: var(--bg-white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    /* 中央配置を強制 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.temp-product-modal .modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    background: var(--light-green);
    border-bottom: 1px solid var(--border-light);
}

.temp-product-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-align: center;
}

.temp-product-modal .close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.temp-product-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.temp-product-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.temp-product-form {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(90, 143, 106, 0.1);
}

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

.add-temp-product-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-temp-product-btn:hover {
    background: var(--dark-green);
    transform: translateY(-1px);
}

.add-temp-product-btn:active {
    transform: translateY(0);
}

.cancel-temp-product-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-temp-product-btn:hover {
    background: var(--bg-light);
    border-color: var(--text-light);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .temp-product-modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .temp-product-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .add-temp-product-btn,
    .cancel-temp-product-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ===================================
   会計完了ポップアップ
   =================================== */

.checkout-complete-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.popup-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(90, 143, 106, 0.1);
    max-width: 400px;
    width: 90%;
    animation: popupSlideIn 0.3s ease-out;
    transition: transform 0.2s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.popup-content h3 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.receipt-summary {
    background: var(--pale-green);
    border-radius: 12px;
    padding: 16px 0;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 過去の履歴モーダル用のsummary-row */
.receipt-summary .summary-row {
    display: flex;
    align-items: center;
    font-size: 16px;
    margin-bottom: 8px;
    padding: 0;
}

.receipt-summary .summary-row:last-child {
    margin-bottom: 0;
}

.receipt-summary .summary-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    min-width: 80px; /* ラベルの最小幅を設定 */
    text-align: left;
    padding-left: 0; /* 商品名と同じ位置に揃える */
    margin-left: 0; /* マージンをリセット */
}

.receipt-summary .summary-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
    text-align: right;
    flex: 1;
}

.receipt-summary .summary-row.total-row {
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 8px;
}

.receipt-summary .summary-row.total-row .summary-label,
.receipt-summary .summary-row.total-row .summary-value {
    font-size: 18px;
    font-weight: 700;
}

.checkout-complete-popup .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-bottom: 12px;
    width: 100%;
    padding: 0 40px;
}

.checkout-complete-popup .summary-value {
    font-weight: 700;
    color: #2c5530;
    font-size: 18px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.highlight {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-green);
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 12px;
}

.summary-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-green);
    margin-left: auto;
}

.close-popup-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #5a8f6a 0%, #4a7c59 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(90, 143, 106, 0.3);
}

.close-popup-btn:hover {
    background: var(--dark-green);
    transform: translateY(-1px);
}

.close-popup-btn:active {
    transform: translateY(0);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .popup-content {
        padding: 24px;
        margin: 20px;
    }
    
    .success-icon {
        font-size: 40px;
    }
    
    .popup-content h3 {
        font-size: 20px;
    }
    
    .summary-row {
        font-size: 14px;
    }
    
    .summary-row.highlight {
        font-size: 16px;
    }
}

/* ===================================
   iPhone 13/14対応の追加CSS
   =================================== */

/* iPhone 13/14 (390x844) 対応 */
@media (max-width: 428px) {
    /* ヘッダーの調整 */
    .header {
        padding: 12px 16px;
    }
    
    .logo {
        max-width: 180px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .daily-closing-btn,
    .logout-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .daily-closing-btn span,
    .logout-btn span {
        display: none;
    }
    
    .daily-closing-btn svg,
    .logout-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* メインコンテンツの調整 */
    .main-content {
        padding: 16px;
        gap: 16px;
    }
    
    /* メニューセクションの調整 */
    .menu-section {
        margin-bottom: 20px;
    }
    
    .menu-section h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .menu-btn {
        padding: 16px 12px;
        font-size: 14px;
        min-height: 48px;
    }
    
    /* 会計エリアの調整 */
    .checkout-section {
        padding: 16px;
    }
    
    .payment-section {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .payment-box,
    .change-box {
        padding: 16px;
    }
    
    .payment-label,
    .change-label {
        font-size: 14px;
    }
    
    .payment-amount,
    .change-amount {
        font-size: 20px;
    }
    
    .quick-amount-btn {
        padding: 12px 8px;
        font-size: 12px;
        min-height: 44px;
    }
    
    /* ボタンの調整 */
    .main-action-btn,
    .clear-btn,
    .secondary-action-btn,
    .report-action-btn {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 48px;
        margin-bottom: 8px;
    }
    
    /* モーダルの調整 */
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    /* 商品グリッドの調整 */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .quantity-controls {
        gap: 8px;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 40px;
        height: 32px;
        font-size: 14px;
    }
    
    .add-product-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
}

/* iPhone 13/14 専用の調整 */
@media (max-width: 390px) {
    /* iPhone 13/14 縦向き表示の最適化 */
    body {
        padding: 12px !important;
        font-size: 16px !important;
    }
    
    .mobile-header {
        padding: 12px 16px !important;
        height: auto !important;
    }
    
    .menu-section {
        padding: 20px !important;
        margin-bottom: 16px !important;
    }
    
    .payment-section {
        gap: 12px !important;
    }
    
    .payment-box, .change-box {
        padding: 16px !important;
    }
    
    /* モーダルの調整 */
    .weekly-history-modal {
        margin: 8px !important;
        max-height: calc(100vh - 16px) !important;
    }
    
    .receipt-card-ios {
        margin-bottom: 8px !important;
    }
    
    .card-content {
        padding: 12px !important;
    }
}

/* iPhone 13/14 横向き対応 */
@media (max-width: 844px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
        gap: 20px;
    }
    
    .menu-sections {
        flex: 1;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .checkout-section {
        flex: 0 0 300px;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* タッチ操作の最適化 */
@media (hover: none) and (pointer: coarse) {
    /* タッチデバイス用のスタイル */
    .menu-btn:hover,
    .quick-amount-btn:hover,
    .main-action-btn:hover,
    .clear-btn:hover,
    .secondary-action-btn:hover,
    .report-action-btn:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .menu-btn:active,
    .quick-amount-btn:active,
    .main-action-btn:active,
    .clear-btn:active,
    .secondary-action-btn:active,
    .report-action-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* タッチターゲットの最小サイズ確保 */
    .menu-btn,
    .quick-amount-btn,
    .main-action-btn,
    .clear-btn,
    .secondary-action-btn,
    .report-action-btn,
    .close-btn,
    .quantity-btn,
    .add-product-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Safe Area対応 (iPhone X以降) */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .checkout-section {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ===================================
   アプリ更新通知バナー
   =================================== */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    padding: 12px 20px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.update-banner.show {
    transform: translateY(0);
}

.update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.update-icon {
    flex-shrink: 0;
}

.update-text {
    flex: 1;
}

.update-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.update-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.update-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 更新通知バナーのモバイル対応 */
@media (max-width: 640px) {
    .update-banner {
        padding: 10px 16px;
    }
    
    .update-content {
        gap: 10px;
    }
    
    .update-title {
        font-size: 13px;
    }
    
    .update-subtitle {
        font-size: 11px;
    }
    
    .update-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ===================================
   左上ポッチ + ロゴ左寄せレイアウト
   =================================== */
/* デスクトップ版同期状態ポッチ */
.status-dot {
    position: fixed;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50; /* オンライン時 */
    z-index: 1001;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-dot.syncing {
    background: #66BB6A;
    animation: pulse-dot 2s infinite;
}

.status-dot.offline {
    background: #ffc107;
}

.status-dot.error {
    background: #f44336;
}

/* モバイル版同期状態ポッチ */
.status-dot-mobile {
    position: fixed;
    top: 6px;
    left: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
    z-index: 1000; /* ハンバーガーボタンより下に */
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-dot-mobile.syncing {
    background: #66BB6A;
    animation: pulse-dot 2s infinite;
}

.status-dot-mobile.offline {
    background: #ffc107;
}

.status-dot-mobile.error {
    background: #f44336;
}

/* ポッチの光るアニメーション */
@keyframes pulse-dot {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}
/* デスクトップ版ロゴ */
.logo {
    display: block;
    height: 40px;
    width: auto;
}

/* モバイル版ロゴ */
.mobile-logo {
    flex: 0; /* flex: 1 から変更 */
    text-align: left; /* 左寄せに変更 */
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-left: 25px; /* ポッチから適度な距離 */
    margin-top: 3px; /* 上マージンを追加 */
}

/* ログイン画面ロゴ */
.login-logo {
    display: block;
    margin: 0 auto;
    height: 70px;
    width: auto;
    max-width: 220px;
}

/* 検索ハイライト */
.search-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 検索結果の商品カード */
.product-card {
    position: relative;
}

.product-card .product-name {
    line-height: 1.4;
}

.product-card .product-brand {
    line-height: 1.3;
}

/* お気に入りボタン */
.product-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.product-modal-favorite-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: #ccc;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-favorite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.product-modal-favorite-btn.favorited {
    color: #ff6b6b;
}

.product-modal-favorite-btn.favorited:hover {
    color: #ff5252;
}

/* ===================================
   エラーモーダル
   =================================== */

.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

.error-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.error-modal-content h3 {
    color: #ef5350;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.error-modal-content p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.error-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.error-modal-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
}

.error-modal-actions .retry-btn {
    background: #2196f3;
    color: white;
}

.error-modal-actions .retry-btn:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.error-modal-actions .close-btn {
    background: #f5f5f5;
    color: #666;
}

.error-modal-actions .close-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   ステータスドット（オンライン/オフライン状態）
   =================================== */

.status-dot.online {
    background: #4caf50; /* 緑 - オンライン */
}

.status-dot.offline {
    background: #ff9800; /* オレンジ - オフライン */
}

.status-dot.error {
    background: #f44336; /* 赤 - エラー */
}

/* 同期中のアニメーション */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===================================
   エラーレポート機能
   =================================== */

.report-content {
    text-align: left;
}

.report-summary {
    background: #f5f5f5;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.report-summary h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.report-summary p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.report-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.report-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.report-actions .export-btn {
    background: #4caf50;
    color: white;
}

.report-actions .export-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.report-actions .clear-btn {
    background: #f44336;
    color: white;
}

.report-actions .clear-btn:hover {
    background: #da190b;
    transform: translateY(-1px);
}

.report-actions .close-btn {
    background: #f5f5f5;
    color: #666;
}

.report-actions .close-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* ===================================
   スマホ対応（日次レポートモーダル）
   =================================== */

@media (max-width: 600px) {
  .daily-report-modal {
    max-width: 95vw !important;
    max-height: calc(100vh - 100px) !important; /* Vivaldi対応: より多くの高さを確保 */
    height: auto !important;
    margin: 0 auto !important;
    left: 50% !important;
    top: 25px !important; /* より上に配置 */
    transform: translateX(-50%) translateY(0) !important;
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    z-index: 10000 !important;
  }
  
  .daily-report-header {
    padding: 12px 20px;
    flex-shrink: 0;
  }
  
  .daily-report-header h2 {
    font-size: 18px !important;
    line-height: 1.2 !important;
  }
  
  .daily-report-content {
    padding: 12px 16px !important;
    height: auto !important;
    max-height: calc(100vh - 120px) !important; /* Vivaldi対応: より多くの高さを確保 */
    min-height: 300px !important; /* Vivaldi対応: 最小高さを大幅に増加 */
    flex: 1;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .daily-report-header .close-btn {
    font-size: 26px !important; /* フォントサイズを増加 */
    padding: 6px !important;
    width: 44px !important; /* サイズを増加 */
    height: 44px !important; /* サイズを増加 */
    margin-top: -1px !important;
    background: rgba(255, 255, 255, 0.3) !important; /* 背景を濃く */
    border: 3px solid rgba(255, 255, 255, 0.8) !important; /* ボーダーを濃く */
    border-radius: 50% !important;
    transform: translateY(-1px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; /* シャドウを追加 */
  }
  
  .report-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
    margin-top: 0 !important;
    position: relative !important;
    top: 0 !important;
    flex-shrink: 0;
  }
  
  .summary-card {
    padding: 24px 16px !important; /* パディングを増加 */
    min-height: 100px !important; /* 最小高さを増加 */
    text-align: center;
  }
  
  .summary-card h3 {
    font-size: 15px !important; /* フォントサイズを少し増加 */
    margin-bottom: 10px !important;
  }
  
  .summary-card .value {
    font-size: 20px !important; /* フォントサイズを増加 */
    font-weight: 700;
  }
  
  .daily-report-modal .empty-report {
    /* より強力なセレクタで通常モードの競合を解決 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    
    /* サイズとスペーシング */
    padding: 16px 20px !important;
    margin: 12px 0 !important;
    min-height: 60px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    
    /* 背景とボーダー */
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    
    /* テキストスタイル */
    font-size: 14px !important;
    font-weight: normal !important;
    color: #333 !important;
    line-height: 1.4 !important;
    
    /* 視覚効果 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    
    /* SafariとChrome共通の強制適用 */
    -webkit-border-radius: 12px !important;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    
    /* レイアウトの強制 */
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1000 !important;
    
    /* 通常モードでの競合を解決 */
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }
  
  .daily-report-footer {
    display: none !important; /* フッターを非表示 */
  }
}

/* ===================================
   デバッグ用 - 実機で確実に表示
   =================================== */

@media (max-width: 600px) {
  /* 実機で確実に表示されるよう強制スタイル */
  .daily-report-modal * {
    max-height: none !important;
  }
  
  .daily-report-modal .empty-report,
  .daily-report-footer {
    display: flex !important; /* block から flex に変更 */
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
    height: auto !important;
    min-height: 60px !important; /* 統一 */
  }
  
  .daily-report-modal .empty-report {
    /* デバッグ用スタイルも統一 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 16px 20px !important;
    margin: 12px 0 !important;
    min-height: 60px !important; /* 統一 */
    width: 100% !important;
    box-sizing: border-box !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: normal !important;
    color: #333 !important;
    line-height: 1.4 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    -webkit-border-radius: 12px !important;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }
  
  .daily-report-footer {
    background: white !important;
    border-top: 1px solid #e0e0e0 !important;
    text-align: center !important;
    padding: 12px 16px !important;
  }
}

/* ===================================
   ログイン画面の自動ログインチェックボックス
   =================================== */

.login-options {
  margin: 20px 0;
  padding: 16px;
  background: rgba(76, 175, 80, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.auto-login-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

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

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

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

.auto-login-checkbox 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);
}

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

.auto-login-description {
  font-size: 12px;
  color: #666;
  margin: 0;
  margin-left: 32px;
  line-height: 1.4;
}

/* ホバー効果 */
.auto-login-checkbox:hover .checkmark {
  border-color: #45a049;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.auto-login-checkbox:hover input[type="checkbox"]:checked + .checkmark {
  background: #45a049;
  border-color: #45a049;
}

/* フォーカス効果 */
.auto-login-checkbox input[type="checkbox"]:focus + .checkmark {
  outline: 2px solid rgba(76, 175, 80, 0.3);
  outline-offset: 2px;
}

/* 更新プロンプトのアニメーション */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

