@charset "UTF-8";

/* ===================================================
   ベース設定 & カラーテーマ (#2c3e50)
=================================================== */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 16px; /* 基本サイズ */
    background-color: #f8f9fa;
    color: #333;
}

/* 画面表示用：強制的に大きくする設定 */
.small, small {
    font-size: 1rem !important;
}
.table {
    font-size: 1rem !important;
}
.form-control, .form-select, .btn {
    font-size: 1rem !important;
}

/* --- テーマカラーの上書き (Bootstrap Override) --- */
.bg-primary { background-color: #2c3e50 !important; }
.btn-primary { background-color: #2c3e50; border-color: #2c3e50; }
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: #1a252f !important; border-color: #1a252f !important;
}
.text-primary { color: #2c3e50 !important; }
.border-primary { border-color: #2c3e50 !important; }
.btn-outline-primary { color: #2c3e50; border-color: #2c3e50; }
.btn-outline-primary:hover { background-color: #2c3e50; color: #fff; }

/* 権限ごとの色 */
.bg-dark { background-color: #212529 !important; }
.bg-success { background-color: #198754 !important; }

/* ===================================================
   ログイン画面
=================================================== */
body.login-body {
    background: #ecf0f1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    max-width: 400px;
    width: 100%;
    border-top: 5px solid #2c3e50;
}

/* ===================================================
   メイン画面
=================================================== */
.navbar {
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.receipt-thumb {
    width: 30px; height: 30px; object-fit: cover;
    border: 1px solid #ccc; border-radius: 4px;
}
.app-row:hover {
    background-color: #e9ecef; cursor: pointer; transition: background-color 0.2s;
}
.table-responsive {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.min-w-150 { min-width: 150px; }
.min-w-200 { min-width: 200px; }
.min-w-100 { min-width: 100px; }

@media (max-width: 576px) {
    body { font-size: 14px; }
    .container { padding-left: 10px; padding-right: 10px; }
    .btn-lg { width: 100%; margin-bottom: 10px; }
    .d-flex.gap-3 { flex-direction: column; gap: 0.5rem !important; }
    .modal-dialog { margin: 0.5rem; }
}

/* ===================================================
   印刷画面 (A4対応調整)
=================================================== */
body.print-body {
    background: #fff;
    padding: 20px;
    /* 印刷時のベース文字サイズを小さく戻す */
    font-size: 12px; 
}

.print-wrap {
    max-width: 900px; /* A4横幅の目安 */
    margin: 0 auto;
    border: 2px solid #000;
    padding: 20px; /* パディングを少し減らす */
}

.p-header {
    border-bottom: 2px solid #000;
    margin-bottom: 15px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.tbl-print {
    width: 100%;
    border-collapse: collapse;
}
.tbl-print th, .tbl-print td {
    border: 1px solid #000 !important;
    padding: 4px; /* 余白を詰める */
}
.tbl-print th {
    background: #eee !important;
    text-align: center;
}

.stamp-area { text-align: right; }
.stamp-box {
    width: 70px; height: 70px; border: 1px solid #000;
    display: inline-block; margin-left: 5px; position: relative; vertical-align: top;
}
.stamp-label {
    font-size: 10px; text-align: center; border-bottom: 1px solid #000;
    background: #eee; line-height: 16px;
}
.stamp-seal {
    width: 54px; height: 54px; border: 2px solid #f00; border-radius: 50%;
    color: #f00; font-size: 11px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    margin: 6px auto 0; text-align: center; line-height: 1.1; flex-direction: column;
}
.stamp-date {
    font-size: 9px; border-top: 1px solid #f00; border-bottom: 1px solid #f00;
    width: 100%; margin: 2px 0;
}

.img-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; page-break-inside: avoid;
}
.img-item {
    border: 1px solid #ddd; padding: 5px; page-break-inside: avoid; text-align: center;
}
.img-item img, .pdf-canvas {
    max-width: 100%; max-height: 400px; object-fit: contain; border: 1px solid #eee;
}

/* 印刷専用の調整（画面設定の !important を打ち消す）
*/
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }

    /* 画面用の強制サイズ指定を解除・上書きして小さくする */
    .table, .tbl-print, .tbl-print th, .tbl-print td {
        font-size: 11px !important; /* 印刷時は11pxに縮小 */
        padding: 4px 2px !important; /* 余白を限界まで詰める */
    }
    
    /* ヘッダー情報なども少し小さく */
    .print-wrap {
        border: none; /* 外枠線を消して用紙の端まで使えるようにするならnone */
        padding: 0;
    }
    
    /* 改行させたくない項目 */
    .text-end, .text-center {
        white-space: nowrap;
    }
}