@charset "utf-8";

/* 印刷設定
---------------------------------------------------------------------------- */

* html body {
	zoom: 70%;
}

@media print {

    /* ==========================================================================
     * 1. 非印刷要素の非表示
     * ========================================================================== */

    /* ヘッダー・メニュー・サイドバー */
    .header,
    .menu,
    .menu-sp,
    .sidebar-menu,
    .sidebar-overlay,
    .breadcrumb {
        display: none !important;
    }

    /* ボタン類 */
    .btn-area,
    .btn,
    .js-addRow,
    .js-removeRow,
    .js-removeSelectedRows,
    .js-viewToggle,
    .js-tabBtn,
    .search-btn,
    .pager,
    .pager-area {
        display: none !important;
    }

    /* フッター・ローディング・通知 */
    .footer,
    .loading,
    .notice-dialog,
    .modal-bg {
        display: none !important;
    }

    /* チェックボックス列（行選択用） */
    .list-check-col {
        display: none !important;
    }

    /* ファイルアップロードUI */
    .file-drop-area,
    .file-remove-btn {
        display: none !important;
    }

    /* ツールチップ */
    .tooltip .tooltip-text {
        display: none !important;
    }

    /* ==========================================================================
     * 2. レイアウト調整
     * ========================================================================== */

    /* メインコンテンツを全幅に */
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .contents {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .main {
        margin: 0 !important;
        padding: 10px !important;
        width: 100% !important;
    }

    /* ==========================================================================
     * 3. テーブルの印刷対応
     * ========================================================================== */

    /* スクロール制限解除 */
    .list-body,
    .edit-list-body,
    .table-scroll,
    .list-table-wrap {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    /* テーブル基本 */
    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    /* テーブルセル罫線を確実に表示 */
    .list-body table th,
    .list-body table td,
    .edit-list-body table th,
    .edit-list-body table td {
        border: 1px solid #ccc !important;
        padding: 4px 8px !important;
    }

    /* 編集可能フィールドを通常テキスト表示 */
    .list-body input,
    .list-body select,
    .edit-list-body input,
    .edit-list-body select {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* ==========================================================================
     * 4. 帳票プレビューのA4印刷レイアウト
     * ========================================================================== */

    /* 帳票プレビュー以外を非表示（帳票印刷モード時） */
    body.printing-doc .contents,
    body.printing-doc .header,
    body.printing-doc .menu {
        display: none !important;
    }

    body.printing-doc .doc-preview {
        display: block !important;
    }

    /* A4サイズ設定 */
    @page {
        size: A4 portrait;
        margin: 10mm 15mm;
    }

    .doc-preview {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .doc-preview-header {
        margin-bottom: 15px !important;
    }

    .doc-preview-title {
        font-size: 18pt !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }

    .doc-preview-amount-box {
        font-size: 14pt !important;
        border: 2px solid #333 !important;
        padding: 8px 20px !important;
        text-align: center !important;
        margin-bottom: 15px !important;
    }

    .doc-preview-info {
        font-size: 9pt !important;
    }

    .doc-preview-info table th,
    .doc-preview-info table td {
        padding: 2px 6px !important;
        font-size: 9pt !important;
    }

    /* 帳票明細テーブル */
    .doc-preview-table {
        width: 100% !important;
        font-size: 9pt !important;
        border-collapse: collapse !important;
    }

    .doc-preview-table th,
    .doc-preview-table td {
        border: 1px solid #333 !important;
        padding: 4px 6px !important;
    }

    .doc-preview-table th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
    }

    .doc-preview-table .tar {
        text-align: right !important;
    }

    /* 合計エリア */
    .doc-preview-totals {
        margin-top: 10px !important;
        font-size: 10pt !important;
    }

    .doc-preview-totals table {
        margin-left: auto !important;
    }

    .doc-preview-totals th,
    .doc-preview-totals td {
        padding: 3px 10px !important;
        border: 1px solid #333 !important;
    }

    /* 備考 */
    .doc-preview-note {
        margin-top: 15px !important;
        font-size: 9pt !important;
        border: 1px solid #ccc !important;
        padding: 8px !important;
    }

    /* 印字ボタン非表示 */
    .doc-preview-actions,
    .print-btn {
        display: none !important;
    }

    /* ==========================================================================
     * 5. 色の印刷保証
     * ========================================================================== */

    /* ステータスラベル */
    .label-blue,
    .label-red,
    .label-yellow,
    .label-green,
    .label-gray,
    .label-orange {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* ステータスバッジ */
    .badge-active,
    .badge-closed,
    .badge-hold,
    .badge-new,
    .badge-draft {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* 統計カード */
    .stat-card {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        border: 1px solid #ccc !important;
    }

    /* カードアクセントカラー */
    .card-grid-item {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* テーブルヘッダー背景 */
    .list-body table thead th,
    .edit-list-body table thead th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        background-color: #f5f5f5 !important;
    }

    /* 変更ハイライト */
    input.is-changed,
    select.is-changed,
    textarea.is-changed {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* ==========================================================================
     * 6. その他の印刷調整
     * ========================================================================== */

    /* リンクのURL表示を抑制 */
    a[href]::after {
        content: none !important;
    }

    /* 検索エリアを非表示（一覧印刷時） */
    .search-box {
        display: none !important;
    }

    /* セクション区切りで改ページ */
    .section {
        page-break-before: auto;
        page-break-inside: avoid;
    }

    /* 編集ボックスの印刷対応 */
    .edit-box {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }

    .edit-box table th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        background-color: #f5f5f5 !important;
    }

    /* ダッシュボード統計エリア */
    .stat-card-grid {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* カードグリッド */
    .card-grid {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .card-grid-item {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
    }

    /* モーダルは非表示 */
    .modal {
        display: none !important;
    }

}
