/* PKE Web 経理システム - スタイルシート */

/* ========================================
   リセット・基本設定
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Meiryo", "Hiragino Kaku Gothic Pro", "Yu Gothic", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #1a73e8;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ========================================
   ヘッダー
   ======================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a237e;
    color: #fff;
    padding: 0 20px;
    height: 48px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .app-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 12px 14px;
    font-size: 13px;
    transition: background 0.2s;
}
.header-nav .nav-link:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
    color: #fff;
}

/* ヘッダーナビ カテゴリーボタン */
.nav-cat-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    padding: 12px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    height: 48px;
    transition: background 0.2s;
}
.nav-cat-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.nav-cat-btn.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: inset 0 -3px 0 #fff;
}

/* サブメニューバー */
.sub-menu-container {
    background: #283593;
    position: sticky;
    top: 48px;
    z-index: 99;
}
.sub-menu-bar {
    display: none;
    padding: 0 20px;
    gap: 2px;
    justify-content: flex-start;
}
.sub-menu-bar.open {
    display: flex;
    flex-wrap: wrap;
}
.sub-menu-link {
    color: rgba(255,255,255,0.9);
    padding: 10px 16px;
    font-size: 13px;
    transition: background 0.2s;
    white-space: nowrap;
}
.sub-menu-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-right .header-company {
    font-size: 13px;
    font-weight: bold;
    opacity: 0.9;
    white-space: nowrap;
}
.header-right .header-fy {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}
.header-right .user-name {
    font-size: 13px;
    opacity: 0.9;
}
/* 管理者用 期切替セレクタ */
.fy-selector {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
.fy-selector:hover {
    background: rgba(255,255,255,0.25);
}
.fy-selector option {
    background: #1a237e;
    color: #fff;
}
.header-right .logout {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
}
.header-right .logout:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
}

/* ヘッダー ドロップダウン（アカウント設定） */
.header-dropdown {
    position: relative;
}
.header-dropdown-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 12px 14px;
    transition: background 0.2s;
}
.header-dropdown-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.header-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 200;
    padding: 4px 0;
}
.header-dropdown.open .header-dropdown-menu {
    display: block;
}
.header-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}
.header-dropdown-menu a:hover {
    background: #e8eaf6;
    color: #1a237e;
    text-decoration: none;
}

/* ========================================
   メインコンテンツ
   ======================================== */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

.app-main h1 {
    font-size: 16px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 2px solid #1a237e;
}

/* ========================================
   フッター
   ======================================== */
.app-footer {
    text-align: center;
    padding: 8px;
    color: #888;
    font-size: 11px;
    margin-top: 16px;
}

/* ========================================
   ログイン画面
   ======================================== */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 40px;
}
.login-container h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 8px;
    border: none;
}
.login-container .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
}

/* ========================================
   フォーム
   ======================================== */
.form-group {
    margin-bottom: 8px;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 12px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}
.form-inline .form-group {
    margin-bottom: 0;
}

/* ========================================
   ボタン
   ======================================== */
.btn {
    display: inline-block;
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}
.btn-primary {
    background: #1a73e8;
    color: #fff;
}
.btn-primary:hover {
    background: #1557b0;
    text-decoration: none;
    color: #fff;
}
.btn-secondary {
    background: #6c757d;
    color: #fff;
}
.btn-secondary:hover {
    background: #565e64;
}
.btn-danger {
    background: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background: #bb2d3b;
}
.btn-success {
    background: #198754;
    color: #fff;
}
.btn-success:hover {
    background: #157347;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}
.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   テーブル
   ======================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.data-table th,
.data-table td {
    padding: 3px 8px;
    border: 1px solid #e0e0e0;
    text-align: left;
    font-size: 12px;
}
.data-table th {
    background: #f0f0f0;
    font-weight: bold;
    white-space: nowrap;
}
/* ホバーは tbody 内のストライプセクションで定義 */
.data-table .text-right,
.text-right {
    text-align: right;
}
.data-table .text-center,
.text-center {
    text-align: center;
}
.data-table .amount {
    text-align: right;
    font-family: "Consolas", "Courier New", monospace;
    white-space: nowrap;
}

/* テーブル ストライプ（偶数行に薄い背景） */
.data-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.data-table tbody tr:hover {
    background: #f0f4f8;
}

/* テーブル スティッキーヘッダー */
.data-table thead.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ========================================
   テーブル行 — 共通セマンティッククラス
   ======================================== */

/* 合計行（最も一般的な集計行） */
.row-total td {
    background: #f5f5f5;
    font-weight: bold;
}

/* セクションヘッダー（資産の部、負債の部 等） */
.row-section-header td {
    font-weight: bold;
}
.row-section-header-blue td    { background: #e3f2fd; font-weight: bold; }
.row-section-header-orange td  { background: #fff3e0; font-weight: bold; }
.row-section-header-green td   { background: #e8f5e9; font-weight: bold; }
.row-section-header-red td     { background: #ffebee; font-weight: bold; }
.row-section-header-indigo td  { background: #eef2ff; font-weight: bold; }

/* 自動生成仕訳（auto_generated）の薄いハイライト */
.row-auto-generated td {
    background: #fffbf0;
}

/* 当期行ハイライト（期間管理テーブル等） */
.row-current td {
    background: #e8f5e9;
}

/* 非入力科目（集計科目等） */
.row-non-inputtable td {
    background: #fff8e1;
}

/* 消費税関連ハイライト */
.row-tax-highlight td {
    background: #fff3e0;
}

/* 期繰越 — 当期純利益行 */
.row-net-income td {
    background: #fffbf0;
    font-weight: bold;
}

/* ========================================
   科目コードリンク（帳票共通）
   ======================================== */
a.acct-link {
    text-decoration: none;
    color: #1565c0;
    border-bottom: 1px dashed #90caf9;
    padding-bottom: 1px;
    transition: color 0.15s, border-bottom-color 0.15s, background 0.15s;
}
a.acct-link:hover {
    color: #0d47a1;
    border-bottom-style: solid;
    border-bottom-color: #0d47a1;
    background: #e3f2fd;
    border-radius: 2px;
}

/* 仕訳番号リンク */
.journal-id-link {
    color: #1565c0;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    padding: 1px 4px;
    border-radius: 2px;
}
.journal-id-link:hover {
    color: #0d47a1;
    background: #e3f2fd;
    text-decoration: none;
}

/* ========================================
   アウトラインボタン（テーブル行内の操作用）
   ======================================== */
.btn-outline {
    background: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}
.btn-outline-primary {
    border: 1px solid #1976d2;
    color: #1976d2;
}
.btn-outline-primary:hover {
    background: #e3f2fd;
}
.btn-outline-danger {
    border: 1px solid #c33;
    color: #c33;
}
.btn-outline-danger:hover {
    background: #fee;
}
.btn-outline-success {
    border: 1px solid #388e3c;
    color: #388e3c;
}
.btn-outline-success:hover {
    background: #e8f5e9;
}

/* 削除フォーム（インライン化） */
.btn-del-form {
    display: inline;
}

/* 仕訳テーブル特有 */
.journal-table .debit {
    background: #fff3e0;
}
.journal-table .credit {
    background: #e3f2fd;
}

/* ========================================
   メニュー画面
   ======================================== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.menu-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px;
    transition: box-shadow 0.2s;
}
.menu-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.menu-card h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #1a237e;
}
.menu-card ul {
    list-style: none;
}
.menu-card li {
    margin-bottom: 6px;
}
.menu-card li a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    color: #333;
    font-size: 13px;
}
.menu-card li a:hover {
    background: #e8eaf6;
    text-decoration: none;
    color: #1a237e;
}

/* ========================================
   アラート・メッセージ
   ======================================== */
.alert {
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 12px;
}
.alert-error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* ========================================
   カード・パネル
   ======================================== */
.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 10px 14px;
    margin-bottom: 10px;
}
.card h2 {
    font-size: 14px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

/* ========================================
   ページネーション
   ======================================== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}
.pagination a:hover {
    background: #e8eaf6;
    text-decoration: none;
}
.pagination .current {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}

/* ========================================
   レスポンシブ
   ======================================== */

/* テーブル横スクロール対応（全画面サイズ共通・念のため） */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 2カラムグリッド（BS・消費税計算など・モバイルで縦積み） */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) {
    .two-col-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* タブレット以下（≤768px） */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    /* ヘッダー */
    .app-header {
        flex-wrap: wrap;
        height: auto;
        padding: 6px 10px;
        gap: 6px;
        position: static; /* モバイルはスティッキー解除（キーボード表示時の領域圧迫回避） */
    }
    .header-left {
        flex: 0 0 auto;
    }
    .header-left .app-title {
        font-size: 15px;
    }
    .header-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        white-space: nowrap;
        border-top: 1px solid rgba(255,255,255,0.15);
        padding-top: 4px;
    }
    .header-nav::-webkit-scrollbar { height: 3px; }
    .header-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); }
    .nav-cat-btn,
    .header-nav .nav-link {
        height: auto;
        padding: 8px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* ヘッダー右（会社名・期・ユーザー・ドロップダウン） */
    .header-right {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
    }
    .header-right .header-company,
    .header-right .header-fy,
    .header-right .user-name {
        font-size: 11px;
    }
    .header-right .header-company {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .fy-selector {
        font-size: 11px;
        padding: 2px 6px;
        max-width: 180px;
    }
    .header-dropdown-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    .header-dropdown-menu {
        right: 0;
        min-width: 160px;
    }
    .header-right .logout {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* サブメニュー（JS の paddingLeft を打ち消す） */
    .sub-menu-container {
        position: static;
        top: auto;
    }
    .sub-menu-bar {
        padding: 2px 8px !important;
    }
    .sub-menu-bar.open {
        flex-wrap: wrap;
    }
    .sub-menu-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* メイン */
    .app-main {
        padding: 8px 10px;
    }
    .app-main h1 {
        font-size: 15px;
    }

    /* フォーム */
    .form-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .form-inline .form-group,
    .form-inline .btn {
        width: 100%;
    }
    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="date"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* iOS Safariのズーム防止：16px以上 */
    }

    /* ボタン */
    .btn {
        padding: 8px 14px; /* タップしやすいサイズ */
        font-size: 13px;
    }
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* テーブル全般：横スクロール化 */
    .data-table,
    .help-compare-table,
    .help-trouble-table,
    .journal-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        width: 100%;
    }
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 4px 6px;
    }
    /* スティッキーヘッダーはモバイルでは解除（display:block化に伴い破綻するため） */
    .data-table thead.sticky-header {
        position: static;
    }

    /* ログイン画面 */
    .login-container {
        max-width: none;
        margin: 24px 12px;
        padding: 24px 20px;
    }
    .login-container h1 {
        font-size: 20px;
    }

    /* メニュー画面 */
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }
    .menu-card {
        padding: 16px 18px;
    }
    .menu-card h2 {
        font-size: 15px;
    }

    /* カード・セキュリティ設定 */
    .card {
        padding: 10px 12px;
    }
    .recovery-codes {
        grid-template-columns: 1fr;
    }
    .qr-container {
        padding: 12px;
    }

    /* ヘルプ・マニュアル */
    .help-page .card {
        padding: 14px 16px;
    }
    .help-page .card h2 {
        font-size: 15px;
    }
    .help-page .card h3 {
        font-size: 13.5px;
        margin-top: 16px;
    }
    .help-compare-table th,
    .help-compare-table td,
    .help-trouble-table th,
    .help-trouble-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* ページネーション */
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* スマートフォン（≤480px） */
@media (max-width: 480px) {
    .header-left .app-title {
        font-size: 14px;
    }
    .header-right {
        gap: 4px;
    }
    .header-right .header-company {
        max-width: 90px;
    }
    /* 画面幅が無いのでユーザー名は隠してドロップダウンに集約 */
    .header-right .user-name {
        display: none;
    }
    .fy-selector {
        max-width: 130px;
    }
    .header-dropdown-menu {
        min-width: 150px;
    }

    .app-main {
        padding: 6px 8px;
    }
    .app-main h1 {
        font-size: 14px;
    }

    .login-container {
        margin: 12px 8px;
        padding: 20px 14px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    }
    .login-container h1 {
        font-size: 18px;
    }

    .menu-card {
        padding: 14px 16px;
    }

    /* ボタンを複数並べたときに折り返す */
    .card .btn + .btn,
    .form-inline .btn + .btn {
        margin-top: 6px;
    }

    .recovery-codes code {
        font-size: 1em;
        padding: 6px 10px;
    }
}

/* ========================================
   セキュリティ設定 / 2FA
   ======================================== */

.qr-container {
    text-align: center;
    margin: 16px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: inline-block;
}

.recovery-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}
.recovery-codes code {
    display: block;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.1em;
    text-align: center;
    letter-spacing: 0.1em;
}

.badge-totp,
.badge-passkey {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
}
.badge-totp {
    background: #2e7d32;
}
.badge-passkey {
    background: #1565c0;
}

/* ========================================
   ヘルプ・マニュアルページ
   ======================================== */

.help-page .card {
    padding: 20px 24px;
}
.help-page .card h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    color: #1a237e;
}
.help-page .card h3 {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid #1a73e8;
}
.help-page .card p {
    margin: 8px 0;
    line-height: 1.8;
}
.help-page .card ul,
.help-page .card ol {
    margin: 8px 0 8px 24px;
    line-height: 1.8;
}
.help-page .card ul {
    list-style: disc;
}
.help-page .card ol {
    list-style: decimal;
}
.help-page .card li {
    margin-bottom: 4px;
}
.help-page .card code {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
}

/* ヘルプ比較テーブル */
.help-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}
.help-compare-table th,
.help-compare-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}
.help-compare-table thead th {
    background: #e8eaf6;
    font-weight: bold;
    text-align: center;
}
.help-compare-table tbody th {
    background: #fafafa;
    font-weight: bold;
    white-space: nowrap;
}
.help-compare-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

/* ヘルプ トラブルシューティングテーブル */
.help-trouble-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.help-trouble-table th,
.help-trouble-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
}
.help-trouble-table thead th {
    background: #fff3e0;
    font-weight: bold;
}
.help-trouble-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

/* ヘルプ 注釈テキスト */
.help-note {
    color: #666;
    font-size: 0.9em;
}
.help-warn {
    color: #c62828;
    font-weight: bold;
}

/* ヘルプ おすすめカード */
.help-recommend {
    background: #f9fbe7;
    border-left: 4px solid #9e9d24;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
}
.help-recommend strong {
    color: #558b2f;
}

/* ========================================
   パスワード表示切替ボタン
   ======================================== */
.pw-wrap {
    position: relative;
}
.pw-wrap input {
    padding-right: 42px;
}
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    width: 28px;
    height: 28px;
    transition: transform 0.25s;
}
.pw-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}
.pw-toggle .eye-open { display: none; }
.pw-toggle .eye-closed { display: block; }
.pw-toggle.active .eye-open { display: block; }
.pw-toggle.active .eye-closed { display: none; }
.pw-toggle:hover {
    transform: translateY(-50%) scale(1.1);
}
.pw-toggle.active {
    animation: pw-eye-open 0.35s ease;
}
.pw-toggle:not(.active) {
    animation: pw-eye-close 0.3s ease;
}
@keyframes pw-eye-open {
    0%   { transform: translateY(-50%) scale(0.8); opacity: 0.5; }
    50%  { transform: translateY(-50%) scale(1.15); }
    100% { transform: translateY(-50%) scale(1); opacity: 1; }
}
@keyframes pw-eye-close {
    0%   { transform: translateY(-50%) scaleY(1); }
    50%  { transform: translateY(-50%) scaleY(0.1); }
    100% { transform: translateY(-50%) scaleY(1); }
}

/* ========================================
   帳票・仕訳画面のモックUI反映（Issue #82）
   ======================================== */

/* フィルタ/ボタン帯のカードラッパー（.card は上で定義済み） */
.filter-bar {
    background: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

/* 最終合計行（BS資産合計・負債純資産合計など）— ネイビー反転 */
tr.row-grand-total td,
tr.row-grand-total th {
    background: #1a237e;
    color: #fff;
    font-weight: bold;
}
tr.row-grand-total td a,
tr.row-grand-total td a:visited {
    color: #fff;
}

/* 帳票キャプション（会社名・期間・基準日などの小さめの見出し） */
.report-header,
.bs-date,
.date-range {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}
.bs-date {
    text-align: right;
    color: #666;
    font-size: 12px;
    margin-bottom: 6px;
}

/* 小計行 */
tr.subtotal td {
    background: #f0f4f8;
    font-weight: bold;
}

/* サブセクション見出し行（Ⅰ 流動資産 等） */
tr.section-sub td {
    background: #fafafa;
    font-style: italic;
    color: #555;
}

/* 5段階利益行（売上総利益・営業利益・経常利益・税引前当期純利益） */
tr.step-profit td {
    background: #fff8e1;
    font-weight: bold;
    border-top: 2px solid #ff9800;
}

/* 最終利益行（当期純利益）— ネイビー反転 */
tr.final-profit td {
    background: #1a237e;
    color: #fff;
    font-weight: bold;
}
tr.final-profit td a,
tr.final-profit td a:visited {
    color: #fff;
}

/* 貸借一致検証バナー */
.bs-balance-check {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}
.bs-balance-check.ng {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}

/* 仕訳日記帳 バッジ */
.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    margin-left: 4px;
}
.badge-auto    { background: #fb8c00; }  /* auto_generated=2 (消費税自動仕訳) */
.badge-hkz     { background: #5e35b1; }  /* auto_generated=1 (HKZ転送) */
.badge-closing { background: #c62828; }  /* auto_generated=3 (決算仕訳) */

/* 仕訳入力テーブル — 借方オレンジ / 貸方ブルー */
table.je-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
table.je-table th,
table.je-table td {
    padding: 4px 6px;
    border: 1px solid #e0e0e0;
}
table.je-table th {
    background: #eef2ff;
    font-weight: bold;
    text-align: center;
}
table.je-table td.dbg { background: #fff3e0; }  /* 借方セル */
table.je-table td.crd { background: #e3f2fd; }  /* 貸方セル */

/* 仕訳入力の合計表示 */
.je-totals {
    display: flex;
    gap: 24px;
    justify-content: flex-end;
    margin-top: 10px;
    font-size: 13px;
}
.je-totals .t-label { color: #666; }
.je-totals .t-value {
    font-family: Consolas, "Courier New", monospace;
    font-weight: bold;
}
.balance-ok { color: #2e7d32; }
.balance-ng { color: #c62828; }
