/* ============================================================
 * KATA LOCKER POS — Stylesheet
 * ビーチで使うことを想定した大きなタッチ領域・高コントラスト
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700&family=Noto+Sans+Thai:wght@400;500;700&display=swap');

:root {
    /* カラーパレット（熱帯ビーチ） */
    --teal: #0a7a6b;
    --teal-dark: #076155;
    --teal-light: #e0f2ef;
    --coral: #e76f51;
    --coral-light: #fde4dc;
    --sand: #faf6f0;
    --sand-dark: #e9e2d4;
    --navy: #1e3a3a;
    --navy-light: #4a6268;
    --cream: #fffbf5;
    --success: #2a9d8f;
    --danger: #c73e3e;
    --warning: #f4a261;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(30, 58, 58, 0.06);
    --shadow: 0 4px 20px rgba(30, 58, 58, 0.08);
    --shadow-lg: 0 8px 32px rgba(30, 58, 58, 0.12);

    --font-heading: 'Plus Jakarta Sans', 'Noto Sans JP', 'Noto Sans Thai', sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Noto Sans JP', 'Noto Sans Thai', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--sand);
    color: var(--navy);
    line-height: 1.5;
    padding-bottom: 0;
    padding-top: 56px; /* モバイルトップバー分 */
    min-height: 100vh;
    overscroll-behavior-y: contain;
}
@media (min-width: 768px) {
    body {
        padding-top: 0;
        padding-left: 220px; /* サイドバー分 */
    }
}

/* ============================================================
 * トップバー
 * ============================================================ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: var(--cream);
    border-bottom: 1px solid var(--sand-dark);
    z-index: 100;
}
.topbar-inner {
    height: 100%;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--sand-dark);
    border-radius: 10px;
    padding: 3px;
}
.lang-switcher a {
    display: block;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-light);
    text-decoration: none;
    border-radius: 7px;
    transition: all 0.2s;
}
.lang-switcher a.active {
    background: var(--teal);
    color: white;
}

/* ============================================================
 * ボトムナビゲーション
 * ============================================================ */
.bottomnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--cream);
    border-top: 1px solid var(--sand-dark);
    display: flex;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}
.navitem {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--navy-light);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s;
}
.navitem.active { color: var(--teal); }
.navicon { font-size: 22px; }
.navlabel { font-size: 10px; letter-spacing: 0.02em; }

/* ============================================================
 * メインコンテンツエリア
 * ============================================================ */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin-bottom: 16px;
}

/* ============================================================
 * POS画面 — 部門タブ
 * ============================================================ */
.pos-tabs {
    display: flex;
    border-bottom: 2px solid var(--sand-dark);
    margin-bottom: 16px;
    gap: 0;
}
.pos-tab {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-light);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    min-height: 44px;
    font-family: var(--font-body);
}
.pos-tab.active {
    color: var(--teal-dark);
    border-bottom-color: var(--teal);
    font-weight: 700;
}
.pos-tab:active { opacity: 0.7; }

/* ============================================================
 * POS画面 — 商品グリッド
 * ============================================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--navy-light);
    margin-bottom: 10px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.item-btn {
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 18px 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    min-height: 120px;
    justify-content: center;
}
.item-btn:active {
    transform: scale(0.97);
    border-color: var(--teal);
    background: var(--teal-light);
}
.item-icon { font-size: 36px; }
.item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--navy);
    line-height: 1.2;
}
.item-price {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--teal);
}

/* カート */
.cart {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    bottom: 16px;
}
.cart-items { margin-bottom: 12px; max-height: 180px; overflow-y: auto; }
.cart-empty {
    text-align: center;
    color: var(--navy-light);
    font-size: 14px;
    padding: 16px;
}
.cart-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--sand-dark);
}
.cart-row:last-child { border-bottom: none; }
.cart-name { font-weight: 600; font-size: 14px; }
.cart-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--sand-dark);
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
}
.qty-val { font-weight: 700; min-width: 20px; text-align: center; }
.cart-price-input {
    width: 62px;
    padding: 4px 6px;
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: right;
    background: var(--sand);
    color: var(--navy);
}
.cart-price-input:focus {
    outline: none;
    border-color: var(--teal);
}
.cart-subtotal { font-weight: 700; min-width: 64px; text-align: right; font-size: 14px; }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0 10px;
    border-top: 2px solid var(--navy);
    margin-top: 8px;
}
.cart-total-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--navy-light);
}
.cart-total-amount {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--teal-dark);
    letter-spacing: -0.02em;
}

.cash-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.cash-field {
    background: var(--sand);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}
.cash-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--navy-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.cash-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
}
.cash-value.change { color: var(--coral); }
.cash-field input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
    outline: none;
}

/* ============================================================
 * ボタン
 * ============================================================ */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    min-height: 52px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--teal);
    color: white;
    box-shadow: 0 4px 14px rgba(10, 122, 107, 0.3);
}
.btn-primary:active { background: var(--teal-dark); }
.btn-coral { background: var(--coral); color: white; }
.btn-secondary { background: var(--sand-dark); color: var(--navy); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 12px;
}
.btn-lg { padding: 20px; font-size: 18px; min-height: 64px; }
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.btn:disabled:active { transform: none; }

/* ============================================================
 * 経費入力画面
 * ============================================================ */
.expense-form {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.category-btn {
    background: var(--sand);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.category-btn:active { transform: scale(0.97); }
.category-btn.selected {
    background: var(--teal-light);
    border-color: var(--teal);
}
.category-icon { font-size: 28px; }
.category-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--navy-light);
    margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--sand);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--navy);
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--teal);
    background: white;
}
.form-input.amount-input {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    text-align: right;
}
.form-textarea { resize: vertical; min-height: 80px; }

.amount-currency-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.radio-btn {
    background: var(--sand);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.radio-btn.selected {
    background: var(--teal-light);
    border-color: var(--teal);
    color: var(--teal-dark);
}

.file-upload {
    border: 2px dashed var(--sand-dark);
    border-radius: var(--radius-sm);
    padding: 30px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.file-upload:hover, .file-upload.has-file {
    border-color: var(--teal);
    background: var(--teal-light);
}
.file-upload input { display: none; }
.file-upload-icon { font-size: 36px; margin-bottom: 8px; }
.file-upload-text { font-size: 14px; color: var(--navy-light); font-weight: 600; }
.file-preview { margin-top: 12px; }
.file-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--sand);
    border-radius: var(--radius-sm);
}
.checkbox-row input[type="checkbox"] {
    width: 22px; height: 22px;
    accent-color: var(--teal);
}

/* ============================================================
 * ダッシュボード
 * ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 14px 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.stat-card.accent { background: var(--teal); color: var(--cream); }
.stat-card.accent .stat-label { color: rgba(255,255,255,0.85); }
.stat-card.accent .stat-value { color: white; }
.stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-light);
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-unit { font-size: 12px; opacity: 0.6; font-weight: 600; margin-left: 2px; }
.stat-sub {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
}
.stat-sub.up { color: var(--success); }
.stat-sub.down { color: var(--danger); }

.chart-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.chart-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 14px;
}
.chart-wrap { position: relative; height: 220px; }

.balance-card {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.balance-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 8px;
}
.balance-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.balance-row:last-child { border-bottom: none; }
.balance-amount { font-family: var(--font-heading); font-weight: 800; font-size: 18px; }

/* ============================================================
 * 履歴
 * ============================================================ */
.filter-bar {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}
.tabs {
    display: flex;
    background: var(--sand-dark);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    color: var(--navy-light);
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 14px;
}
.tab.active { background: var(--cream); color: var(--teal); box-shadow: var(--shadow-sm); }

.txn-list {
    background: var(--cream);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.txn-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--sand-dark);
    align-items: center;
}
.txn-row:last-child { border-bottom: none; }
.txn-row.cancelled {
    opacity: 0.5;
}
.txn-row.cancelled .txn-title,
.txn-row.cancelled .txn-amount {
    text-decoration: line-through;
}
.badge-cancelled {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: var(--sand-dark);
    color: var(--navy-light);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    text-decoration: none;
}
.btn-cancel-txn {
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--navy-light);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.btn-cancel-txn:hover { background: var(--danger); color: white; }
.btn-cancel-txn-placeholder { width: 28px; height: 28px; display: inline-block; }
.txn-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.txn-body { min-width: 0; }
.txn-title { font-weight: 700; font-size: 14px; color: var(--navy); }
.txn-sub { font-size: 12px; color: var(--navy-light); margin-top: 2px; }
.txn-amount {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 16px;
    white-space: nowrap;
}
.txn-amount.income { color: var(--teal); }
.txn-amount.expense { color: var(--coral); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--navy-light);
}
.empty-state-icon { font-size: 48px; opacity: 0.4; margin-bottom: 12px; }

/* ============================================================
 * 設定
 * ============================================================ */
.settings-section {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.settings-section h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--navy);
}
.admin-list {
    list-style: none;
}
.admin-list li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--sand-dark);
}
.admin-list li:last-child { border-bottom: none; }

/* ============================================================
 * トースト通知
 * ============================================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy);
    color: white;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 200;
    font-size: 14px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* モーダル（会計完了・削除確認など） */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 58, 58, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-icon { font-size: 60px; margin-bottom: 14px; }
.modal h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 10px;
}
.modal p { color: var(--navy-light); margin-bottom: 20px; }
.confirm-breakdown {
    background: var(--sand);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: left;
}
.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--sand-dark);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row-change strong {
    font-size: 18px;
    color: var(--teal);
}
.datetime-specify {
    margin-bottom: 14px;
    text-align: center;
}
.datetime-toggle {
    background: none;
    border: none;
    color: var(--teal);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.datetime-toggle:hover { background: var(--teal-light); }
.datetime-picker {
    margin-top: 8px;
}
.datetime-picker.hidden { display: none; }

/* レスポンシブ */
@media (min-width: 600px) {
    .item-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
    .item-grid { grid-template-columns: repeat(4, 1fr); }
    .pos-layout {
        grid-template-columns: 1fr 360px;
        align-items: start;
    }
    .cart { position: sticky; top: 80px; }
}

/* ============================================================
 * サイドバーナビゲーション
 * ============================================================ */

/* モバイル用トップバー */
.mobile-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--cream);
    border-bottom: 1px solid var(--sand-dark);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 90;
}
.mobile-topbar .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.mobile-logo-img {
    height: 44px;
    width: auto;
    display: block;
}
@media (min-width: 768px) {
    .mobile-topbar { display: none; }
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--navy);
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s;
}
.sidebar-toggle:hover { background: var(--sand-dark); }

/* サイドバー本体 */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: var(--cream);
    border-right: 1px solid var(--sand-dark);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
@media (min-width: 768px) {
    .sidebar { transform: translateX(0); }
}

/* モバイル時のオーバーレイ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}
.sidebar-overlay.show { display: block; }
@media (min-width: 768px) {
    .sidebar-overlay { display: none !important; }
}

/* ロゴエリア */
.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 12px;
    flex-shrink: 0;
}
.sidebar-logo-icon { font-size: 22px; }
.sidebar-logo-img {
    width: 210px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* 区切り線 */
.sidebar-divider {
    height: 1px;
    background: var(--sand-dark);
    margin: 4px 12px;
    flex-shrink: 0;
}

/* ナビ項目 */
.sidebar-nav {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--navy-light);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-item:hover {
    background: var(--sand);
    color: var(--navy);
}
.sidebar-item.active {
    background: white;
    color: var(--teal-dark);
    box-shadow: var(--shadow-sm);
}
.sidebar-item-icon { font-size: 18px; line-height: 1; }
.sidebar-item-label { flex: 1; }

/* スペーサー */
.sidebar-spacer { flex: 1; }

/* 言語セグメントコントロール */
.sidebar-lang {
    padding: 8px 12px 12px;
    flex-shrink: 0;
}
.hist-filter-bar {
    margin-bottom: 12px;
    display: flex;
    justify-content: flex-end;
}
.hist-filter-segment {
    display: flex;
    background: var(--sand-dark);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.hist-filter-segment a {
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy-light);
    text-decoration: none;
    transition: all 0.15s;
}
.hist-filter-segment a.active {
    background: white;
    color: var(--teal-dark);
    box-shadow: var(--shadow-sm);
}
.lang-segment {
    display: flex;
    background: var(--sand-dark);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.lang-segment a {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--navy-light);
    text-decoration: none;
    transition: all 0.15s;
}
.lang-segment a.active {
    background: white;
    color: var(--teal-dark);
    box-shadow: var(--shadow-sm);
}

/* フッター（ログアウト） */
.sidebar-footer {
    padding: 0 10px 16px;
    flex-shrink: 0;
}
.sidebar-logout { color: var(--navy-light) !important; }
.sidebar-logout:hover { color: var(--danger) !important; background: #fff0f0 !important; }

/* ミャンマー語フォント対応 */
.lang-my,
html[lang="my"] body {
    font-family: "Padauk", "Myanmar Text", "Noto Sans Myanmar", sans-serif;
}
