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

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    /* 濃いネイビー */
    --accent-color: #007bff;
    /* 鮮やかなブルー（ログインボタンと統一） */
    --success-color: #27ae60;
    /* グリーン */
    --warning-color: #e67e22;
    /* オレンジ */
    --danger-color: #c0392b;
    /* レッド */
    --background-color: #f4f6f7;
    /* 薄いグレー背景 */
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* ヘッダー */
header {
    background-color: var(--card-bg);
    padding: 0;
    height: 64px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.header-inner.is-guest {
    justify-content: center;
}

.header-branding {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
}

header h1 a {
    color: var(--accent-color);
    text-decoration: none;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

header h1 a i {
    margin-right: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name-badge {
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

nav a i {
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

nav a:hover i {
    color: var(--accent-color);
}

nav a:hover {
    color: var(--accent-color);
}

.logout-btn-header {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0;
    margin-left: 10px;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* コンテンツエリア */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* カードスタイル */
.card,
article.case-detail,
.card-form {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 32px;
    margin-bottom: 24px;
}

/* テーブルスタイル */
.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: #f8f9fa;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 16px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* 申請件名（左寄せ）のパディング調整 */
.text-left {
    text-align: left;
    padding-left: 30px !important;
}

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

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

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #fcfcfc;
}

/* リンク */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* リンク定義は上記で集約済み */

/* ユーティリティ */
/* .text-left 定義は上記で集約済み */

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

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.status-draft {
    background: #ecf0f1;
    color: #7f8c8d;
}

.status-submitted {
    background: #e3f2fd;
    color: var(--accent-color);
}

.status-approved {
    background: #e8f8f5;
    color: #27ae60;
}

.status-remanded {
    background: #fdedec;
    color: #c0392b;
}

/* ボタン */
button {
    font-family: inherit;
    cursor: pointer;
    /* 手のひらマークを基本設定へ */
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 24px;
    background-color: var(--accent-color);
    color: white !important;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    min-width: 120px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    line-height: 1;
    box-sizing: border-box;
}

.button:hover {
    background-color: #0069d9;
    transform: translateY(-1px);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 24px;
    background-color: #7f8c8d;
    color: white !important;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    min-width: 120px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    line-height: 1;
    box-sizing: border-box;
}

.button-outline-danger {
    background-color: transparent !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.button-primary-bold {
    font-weight: 500 !important;
}

.button-success {
    background-color: var(--success-color) !important;
}

.button-danger {
    background-color: var(--danger-color) !important;
}

/* AI自動作成・領収書から自動入力ボタン */
.button-ai {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #6f42c1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    /* 他のボタンと同じサイズに合わせる */
}

/* フォーム要素 */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea,
input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

@media screen and (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 24px;
    }
}

.large-input {
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    padding: 14px 20px !important;
    color: var(--primary-color);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    /* 太字にして階層を明確化 */
    font-size: 0.95rem;
    /* サイズを少し調整 */
    color: var(--primary-color);
    /* 色を濃くして視認性向上 */
}

/* 詳細画面 */
.meta {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.95rem;
}

.case-body {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* 履歴タイムライン */
.history ul {
    padding-left: 20px;
}

.history li {
    padding-left: 24px;
    margin-bottom: 24px;
    border-left: 2px solid var(--border-color);
    position: relative;
    list-style: none;
}

.history li::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
}

/* アップロード */
.upload-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
}

.hidden-file-input {
    display: none !important;
}

/* --- レスポンシブ対応 (モバイル向け) --- */
/* --- レスポンシブ対応 (モバイル向け: 767px以下 = スマホのみ対象) --- */
@media screen and (max-width: 767px) {
    html {
        font-size: 118%;
        /* 全体のベースを「おじさま」向けに大幅アップ (110%からさらに拡大) */
    }

    header {
        height: auto;
        padding: 10px 0;
    }

    .header-inner {
        flex-direction: row !important;
        justify-content: space-between !important;
        flex-wrap: nowrap;
        /* 強制的に横並びを維持 */
        gap: 5px;
        text-align: left;
        padding: 0 10px;
        height: 60px;
    }

    .user-name-badge {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .header-branding {
        gap: 0;
    }

    header h1 {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
    }

    .user-info {
        flex-direction: row;
        /* 横並びに戻す */
        gap: 8px;
        width: auto;
        margin-top: 0;
    }

    .user-name-badge {
        font-size: 0.85rem;
        padding: 4px 10px;
        margin: 0;
    }

    nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        flex-wrap: nowrap;
    }

    nav>form {
        display: contents;
        /* フォームの箱を消して、ボタンを直接 nav の子として扱う */
    }

    nav a {
        margin: 0;
        padding: 5px 0;
        /* タップ領域の確保 */
        font-size: 1.1rem;
        /* 0.95remから引き上げ */
        font-weight: 500;
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        display: inline-block;
        line-height: 1.5;
    }

    .logout-btn-header {
        margin: 0;
        padding: 4px 12px;
        background: #f1f3f5;
        border: 1px solid #dee2e6;
        border-radius: 20px;
        color: #dc3545;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .container {
        margin: 20px auto;
        padding: 0 8px;
        /* パディングを極力減らして中身の幅を確保 */
    }

    .card,
    article.case-detail,
    .card-form,
    .search-card {
        padding: 16px;
        /* モバイルではさらに詰める */
    }

    /* テーブル表示の最適化 */
    .table-container {
        background: transparent;
        box-shadow: none;
    }

    @media screen and (max-width: 600px) {

        table,
        thead,
        tbody,
        th,
        td,
        tr {
            display: block;
            width: 100%;
        }

        thead {
            display: none;
            /* ヘッダーを隠す */
        }

        tr {
            background: var(--card-bg);
            margin-bottom: 16px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            padding: 12px;
            border: 1px solid var(--border-color);
            width: 100%;
        }

        td {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 10px 0;
            border-bottom: 1px solid #f2f2f2;
            font-size: 0.95rem !important;
            gap: 8px;
            width: 100%;
        }

        td:last-child {
            border-bottom: none;
        }

        td::before {
            content: attr(data-label);
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.75rem;
            text-align: left;
            flex-shrink: 0;
            width: 75px;
            padding-top: 3px;
        }

        /* センター表示のtd（データがありません 等） */
        td.text-center {
            justify-content: center !important;
            text-align: center !important;
        }

        td.text-center::before {
            display: none !important;
        }

        /* tdの中身（右側）のスタイル */
        td>a,
        td>strong,
        td>span,
        td>small {
            flex: 1;
            min-width: 0;
            text-align: right;
            overflow-wrap: break-word;
            word-break: break-all;
            display: block;
        }

        .text-left {
            padding-left: 0 !important;
        }

        /* 金額を強調 */
        td[data-label="金額"] strong {
            font-size: 1.2rem;
            color: var(--primary-color);
        }
    }

    /* 600px以上のタブレット等では横スクロールを維持 */
    /* 600px以上のタブレット等では横スクロールを維持 */
    @media screen and (min-width: 601px) and (max-width: 767px) {
        .table-container {
            overflow-x: auto;
            background: var(--card-bg);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        table {
            min-width: 700px;
            /* 600から700に増やして余裕を持たせる */
        }

        th,
        td {
            white-space: nowrap;
        }
    }

    /* 詳細画面メタ情報 */
    .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.9rem;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    /* 金額・カテゴリー等の情報グリッド */
    .expense-info {
        flex-direction: row !important;
        /* 横並びを維持しつつ */
        flex-wrap: wrap !important;
        /* 折り返しを許可 */
        gap: 15px !important;
        /* 隙間を詰める */
        padding: 15px !important;
    }

    .expense-info>div {
        flex: 1 1 120px;
        /* 120pxをベースに伸縮、足りなければ折り返す */
        min-width: 0;
        /* 文字溢れ防止 */
    }

    .expense-info>div:first-child {
        flex: 1 1 100%;
        /* 金額は一番上に大きく表示 */
        border-bottom: 2px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 5px;
    }

    /* ボタン */
    .button,
    .button-secondary,
    .card-form button[type="submit"],
    .actions form {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-left: 0 !important;
        margin-bottom: 12px;
        box-sizing: border-box;
        height: 64px !important;
        /* 申請・下書きボタンも巨大化 */
        font-size: 1.25rem !important;
        font-weight: 700 !important;
        border-radius: 14px !important;
    }

    .actions,
    .attachment-list,
    form>div[style*="display: flex"] {
        flex-direction: column !important;
        width: 100%;
    }

    .attachment-item {
        width: 100% !important;
    }

    /* モバイルでのフォーム入力欄の文字サイズを16pxに強制 (iOS拡大防止 & 可読性) */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 18px !important;
        /* 16pxから引き上げ */
        padding: 14px 16px;
        /* パディングも増やす */
    }

    /* ラベルを大きく太くして視認性アップ */
    .form-group label {
        display: block;
        font-size: 1.15rem !important;
        font-weight: 800 !important;
        margin-bottom: 8px;
        color: #333;
    }

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

    /* AI解析ボタンを「おじさま」向けに巨大化 */
    .button-ai {
        height: 72px !important;
        font-size: 1.4rem !important;
        /* 圧倒的インパクト */
        font-weight: 900 !important;
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
        border-radius: 18px !important;
        box-shadow: 0 8px 25px rgba(111, 66, 193, 0.4) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
}

/* AI自動作成中のアニメーション（点滅） */
@keyframes pulse-animation {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.is-processing {
    animation: pulse-animation 1.5s infinite ease-in-out !important;
    pointer-events: none !important;
    opacity: 0.7;
}

.processing-text::after {
    content: " 生成中...";
    font-size: 1.0em;
}

/* OCR結果入力時のハイライト効果 */
@keyframes highlight-fade {
    0% {
        background-color: rgba(46, 204, 113, 0.2);
        border-color: #2ecc71;
        box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    }

    100% {
        background-color: #fff;
        border-color: var(--border-color);
        box-shadow: none;
    }
}

.ocr-fill-highlight {
    animation: highlight-fade 2s ease-out;
}

/* スマホ/PC表示の切り替え */
/* スマホ/PC表示の切り替え */
@media screen and (max-width: 767px) {
    .pc-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-camera-area {
        display: block !important;
    }

    .upload-drop-zone {
        padding: 20px 10px !important;
        border-style: solid !important;
        /* モバイルでは点線より実線の方がタップ領域として認識しやすい */
        background-color: #fcfcfc;
    }
}

/* 検索フォーム */
.search-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 24px;
}

.search-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 columns for tablet/smaller screens */
    gap: 20px;
    align-items: flex-end;
}

@media screen and (min-width: 1024px) {
    .search-form-grid {
        grid-template-columns: 1.2fr 1.8fr 1fr 1fr;
        /* 4 columns for desktop */
    }
}

.search-input {
    width: 100%;
}

.date-range-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-container input {
    flex: 1;
    min-width: 0;
    /* Important for flex items to shrink below content size */
}

.search-form-grid label {
    white-space: nowrap;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.search-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media screen and (max-width: 767px) {
    .search-form-grid {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
    }

    .search-actions .button {
        width: 100%;
    }
}

/* 検索トグル (アコーディオン) */
.search-toggle-btn {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    /* 文字サイズ拡大 */
    font-weight: 400;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.search-toggle-btn:hover {
    background: #f8f9fa;
    border-color: var(--accent-color);
}

.search-form-body {
    display: none;
    /* デフォルト非表示 */
}

.search-form-body.is-open {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid #eee;
    margin-top: 5px;
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown:hover .dropdown-menu,
.dropdown.is-active .dropdown-menu {
    display: block;
}

.dropdown-toggle i {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.2s;
}

.dropdown:hover .dropdown-toggle i,
.dropdown.is-active .dropdown-toggle i {
    transform: rotate(180deg);
}

/* モバイル対応の追加スタイル */
/* モバイル対応の追加スタイル */
@media screen and (max-width: 767px) {

    /* ヘッダーボタンエリア */
    .dropdown-toggle {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
    }

    /* 新規申請ボタンを「おじさま」向けに超巨大化 (iPhone SEでも絶対外さないサイズ) */
    .list-header-actions .button-primary-bold {
        width: 100% !important;
        height: 72px !important;
        /* 圧倒的な打ちごたえ */
        font-size: 1.4rem !important;
        /* 文句なしの特大文字 */
        font-weight: 900 !important;
        border-radius: 18px !important;
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.45) !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-top: 5px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    /* 検索フォームを完全に1カラムに & はみ出し防止 */
    .search-card form>div[style*="grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .search-card form>div[style*="grid"]>div {
        width: 100% !important;
        grid-column: span 1 !important;
    }

    /* テーブル内の文字も大きく */
    table td,
    table th {
        font-size: 1.05rem !important;
    }

    .search-card input,
    .search-card select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        /* はみ出し防止 */
    }

    /* 検索ボタンエリアのモバイル調整 */
    .search-card form>div[style*="justify-content"] {
        flex-direction: column !important;
    }

    .search-card form>div[style*="justify-content"] .button,
    .search-card form>div[style*="justify-content"] a {
        width: 100% !important;
        min-width: auto !important;
        text-align: center;
    }

    /* 一覧画面のアクションエリア */
    .list-header-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        margin-top: 15px;
    }

    .list-header-actions>* {
        width: 100% !important;
        margin: 0 !important;
    }

    .list-header-actions .button,
    .list-header-actions .dropdown,
    .list-header-actions .dropdown-toggle {
        width: 100% !important;
        height: 48px !important;
        /* タップしやすい高さに統一 */
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .date-range-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .date-range-container input {
        flex: 1 1 100% !important;
        /* モバイルでは1個ずつ縦に並べる方が安全 */
        width: 100% !important;
    }

    .date-range-container span {
        display: none;
        /* 「〜」を消して、縦並びにする */
    }
}

/* 会社ロゴ */
.company-logo {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
    /* Fallback */
    background: linear-gradient(135deg, var(--primary-color), #0069d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    white-space: nowrap;
    margin-right: 15px;
    /* gapの代替 */
}

@media screen and (max-width: 767px) {
    .company-logo {
        display: none !important;
        /* ロゴ枠は非表示 */
    }

    /* タイトルの2行崩れを防止 */
    .brand-jp {
        display: none;
    }

    header h1 {
        white-space: nowrap;
    }
}

/* ブランド用フォント設定 */
.brand-en {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-jp {
    font-family: 'IBM Plex Sans JP', sans-serif;
    font-weight: 600;
}

/* ログイン画面用 */
.login-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 0 20px;
}

.login-branding {
    text-align: center;
    margin-bottom: 30px;
}

.login-branding .brand-logo-text {
    font-size: 2.8rem;
    font-weight: 800;
    color: #007bff;
    letter-spacing: -0.02em;
    display: block;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.login-branding .brand-subtext {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

.button-vivid-blue {
    background-color: #007bff !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    height: 52px !important;
    transition: all 0.2s ease !important;
}


.button-vivid-blue:hover {
    background-color: #0069d9 !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* =========================================
   Mobile Bottom Navigation & FAB (Oji-UX)
   ========================================= */

/* デフォルトでは非表示 (PC/Tablet) */
.mobile-bottom-nav {
    display: none;
}

.fab-container {
    display: none;
}

@media screen and (max-width: 767px) {

    /* コンテンツが下に隠れないように余白を追加 */
    body {
        padding-bottom: 80px;
    }

    /* ボトムナビゲーション */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: #ffffff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-top: 1px solid #e0e0e0;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.7rem;
        flex: 1;
        height: 100%;
    }

    .nav-item i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .nav-item.active {
        color: var(--accent-color);
        font-weight: 600;
    }

    /* Floating Action Button (FAB) */
    .fab-container {
        display: flex;
        /* モバイルでのみ表示 */
        position: fixed;
        bottom: 75px;
        /* ボトムナビの上に配置 */
        right: 20px;
        z-index: 1001;
    }

    .fab {
        width: 56px;
        height: 56px;
        background-color: var(--accent-color);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        text-decoration: none;
        transition: transform 0.2s;
    }

    .fab:active {
        transform: scale(0.95);
    }

    .fab i {
        font-size: 1.5rem;
    }

    /* PC用のヘッダーナビを隠す（ボトムナビへの移行） */
    header nav {
        display: none !important;
    }
}

/* 一覧行のクリック対応 */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #f1f3f5 !important;
}