/* =========================
   라이트 고정 (다크모드 무시)
   ========================= */
html, body{
    background:#f4f6f9 !important;
    color:#111827 !important;
}
body *{ color: inherit; }

.app-wrapper,
.app-main,
.app-content,
.app-content-header{
    background:transparent !important;
}

/* =========================
   래퍼
   ========================= */
.estimate-wrapper{
    background:#fff;
    border-radius:12px;
    padding:20px 18px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

/* =========================
   섹션 박스
   ========================= */
.section-box{
    border-top:1px solid #e5e7eb;
    padding:10px 0;
    margin-top:10px;
}
.section-box:first-child{
    border-top:0;
    padding-top:0;
}

.section-content,
.section-box .collapse{
    border:0 !important;
}

/* =========================
   섹션 타이틀 (기본정보 같은 곳)
   ========================= */
.section-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:12px;
}

/* ✅ 모든 섹션 타이틀 폰트 통일 */
.section-title .title,
.section-toggle .left .title{
    font-size:17px;
    font-weight:800;
    letter-spacing:-0.2px;
}

.section-badge{
    font-size:12px;
    padding:4px 10px;
    border-radius:999px;
    background:#f1f5f9;
    border:1px solid #e5e7eb;
    color:#475569;
    white-space:nowrap;
}
.hint-text{
    font-size:13px;
    color:#64748b;
    margin-bottom:8px;
}

/* =========================
   폼
   ========================= */
.form-label{
    font-weight:600;
    color:#334155;
    margin-bottom:6px;
}
.form-control{
    font-size:15px;
    border-radius:10px;
    border:1px solid #e5e7eb;
    height:44px;
    background:#fff;
    color:#111827;
}
textarea.form-control{ height:auto; }
.form-control:disabled{
    background:#f8fafc;
    color:#64748b;
}

/* =========================
   버튼(현장용)
   ========================= */
.btn-touch{
    height:44px;
    padding:0 14px;
    border-radius:10px;
    font-size:15px;
    font-weight:600;
}

/* 복붙 버튼 줄 */
.bulk-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

/* =========================
   섹션 하단
   ========================= */
.section-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:12px;
    flex-wrap:wrap;
}
.total-chip{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
}
.total-chip .label{
    font-size:13px;
    color:#64748b;
    font-weight:600;
}
.total-chip .value{
    font-size:16px;
    font-weight:800;
    color:#2563eb;
}

/* =========================
   영수증 그리드
   ========================= */
.receipt-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
}
.receipt-grid img,
.receipt-thumb{
    width:100%;
    height:110px;
    object-fit:cover;
    border-radius:10px;
    border:1px solid #e5e7eb;
    background:#f8fafc;
}

/* =========================
   하단 버튼
   ========================= */
.estimate-footer{
    margin-top:18px;
    padding-top:16px;
    border-top:1px solid #e5e7eb;
}

/* 모바일 하단 고정 버튼(쓰면) */
.mobile-actions{ display:none; }

/* =========================
   섹션 접기/펼치기 헤더 (✅ 중복 제거: 이 블록만 유지)
   ========================= */
.section-toggle{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:16px 0;
    border:0;
    background:transparent;
    text-align:left;
}

/* 왼쪽 포인트 바 */
.section-toggle .left{
    position:relative;
    flex:1 1 auto;
    min-width:0;
    display:flex;
    align-items:center;
    gap:10px;
    padding-left:14px; /* 포인트바 자리 */
}
.section-toggle .left::before{
    content:"";
    position:absolute;
    left:0;
    top:50%;
    transform: translateY(-50%);
    width:4px;
    height:18px;
    border-radius:999px;
    background:#2563eb;
    opacity:.9;
}

.section-toggle .right{
    display:flex;
    align-items:center;
    gap:10px;
    flex:0 0 auto;
    min-width:170px;          /* 오른쪽 영역 흔들림 방지 */
    justify-content:flex-end;
}

/* 금액 칩 */
.section-toggle .mini-total{
    font-weight:800;
    color:#2563eb;
    background:#eff6ff;
    border:1px solid #dbeafe;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;

    display:flex;
    align-items:center;
    justify-content:center;
    min-width:92px;
    white-space:nowrap;

    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* 펼치기/접기 */
.toggle-text{
    font-size:13px;
    font-weight:600;
    color:#6b7280;
    padding:6px 10px;
    border:1px solid #e5e7eb;
    border-radius:999px;
    background:#fff;

    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:58px; /* "펼치기"/"접기" 폭 고정 */
    white-space:nowrap;
}

/* =========================
   작업 항목(철거/설비 row) 카드형
   - JS가 append하는 .row.g-2.mb-2...에 적용됨
   ========================= */
.work-card-list > .row{
    margin:0 0 10px 0 !important;
    padding:12px 10px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
    box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.work-card-list > .row .form-control{
    height:42px;
    border-radius:10px;
}
.work-card-list input[disabled]{
    background:#f8fafc !important;
    font-weight:700;
}
.work-card-list > .row .btn-danger,
.work-card-list > .row .btn-outline-danger{
    border-radius:10px;
}

/* =========================
   ✅ 모바일에서 가로폭 확보(거터/패딩/버튼/높이 줄이기)
   - 네가 요청한 “마진 최대한 없애기”
   ========================= */
@media (max-width:576px){

    .container-fluid{
        padding-left:3px !important;
        padding-right:3px !important;
    }

    .estimate-wrapper{
        padding:12px 6px !important;
    }

    .form-control{
        font-size:14px;
        height:42px;
    }

    .btn-touch{
        height:42px;
        font-size:14px;
    }

    /* 모바일에서는 아래 고정바만 쓸 때 */
    .estimate-footer{ display:none; }
    .mobile-actions{
        display:flex;
        position:fixed;
        left:0; right:0; bottom:0;
        gap:10px;
        padding:10px 12px;
        background:rgba(255,255,255,.96);
        border-top:1px solid #e5e7eb;
        z-index:999;
    }
    body{ padding-bottom:80px; }

    /* ✅ row g-2 간격 줄이기 (핵심) */
    .work-card-list .row.g-2{
        --bs-gutter-x: 0.25rem;   /* 기본 0.5rem → 0.25rem */
        --bs-gutter-y: 0.25rem;
    }

    /* ✅ mb-2 줄이기 */
    .work-card-list .row.mb-2{
        margin-bottom: 0.25rem !important;
    }

    /* ✅ 카드 padding도 조금 줄이기 */
    .work-card-list > .row{
        padding:10px 8px;
    }

    /* ✅ 카드 내부 input 더 타이트하게 */
    .work-card-list > .row .form-control{
        padding:0.25rem 0.35rem !important;
        font-size:12px !important;
        line-height:1.2 !important;
        height:32px !important;
    }

    /* ✅ 삭제 버튼(col-1)도 타이트하게 */
    .work-card-list > .row .btn[class*="remove_"],
    .work-card-list > .row .btn.btn-danger{
        padding:0.25rem 0 !important;
        font-size:12px !important;
        height:32px !important;
        min-width:28px;
    }

    /* number input 오른쪽 공간 약간 줄이기 */
    .work-card-list input[type="number"]{
        padding-right:0.2rem !important;
    }

    .section-title .title,
    .section-toggle .left .title{
        font-size:16px;
    }

    /* 자재비 체크박스 라벨 톤다운 */
    .material_flags .form-check-label {
        font-size: 13px;   /* 기존보다 살짝 작게 */
        color: #5a5d65;    /* Bootstrap secondary 톤 */
        margin-top: 1px;   /* 수직 정렬 미세조정 */
    }
}
/* =========================================================
   2026-11 리디자인 (시안: 흰 바탕 / 얇은 구분선 / 연파랑 금액 / 흰 버튼)
   - 위쪽 기존 규칙은 그대로 두고 여기서 덮어씀 (.estimate-wrapper 범위)
   ========================================================= */
html, body{ background:#fff !important; }

.estimate-wrapper{
    background:transparent;
    border-radius:0;
    padding:0;
    box-shadow:none;
}

/* ---------- 라벨 / 입력칸 ---------- */
.estimate-wrapper .form-label{
    font-size:13px;
    font-weight:500;
    color:var(--t-grey800, #333d4b);
    margin-bottom:6px;
}
.estimate-wrapper .form-control,
.estimate-wrapper .form-select{
    height:42px;
    font-size:13.5px;
    border:1px solid var(--t-grey200, #e5e8eb);
    border-radius:8px;
    color:var(--t-grey900, #191f28);
    background-color:#fff;
}
.estimate-wrapper textarea.form-control{ height:auto; min-height:100px; }
.estimate-wrapper .form-control:disabled,
.estimate-wrapper .form-control[readonly]{
    background-color:#f2f4f6;
    color:var(--t-grey600, #6b7684);
}
.estimate-wrapper input[type="file"].form-control{ height:auto; padding:9px 12px; }

/* 업체 / 현장 주소 (select2) */
.estimate-wrapper .select2-container--bootstrap4 .select2-selection--single{
    height:42px !important;
    border:1px solid var(--t-grey200, #e5e8eb) !important;
    border-radius:8px !important;
    background-color:#fff;
}
.estimate-wrapper .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{
    line-height:40px !important;
    padding-left:12px !important;
    font-size:13.5px;
    color:var(--t-grey900, #191f28);
}
.estimate-wrapper .select2-container--bootstrap4 .select2-selection__placeholder{ color:var(--t-grey600, #6b7684); }
.estimate-wrapper .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow{
    top:0 !important;
    right:10px !important;
    height:40px !important;
}
.estimate-wrapper .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b{
    top:50% !important;
    border-color:var(--t-grey600, #6b7684) transparent transparent transparent !important;
}
.estimate-wrapper .select2-container--bootstrap4.select2-container--disabled .select2-selection--single{
    background-color:#f2f4f6 !important;
}

/* ---------- 섹션: 카드 없이 얇은 구분선 ---------- */
.estimate-wrapper .section-box{
    border-top:1px solid var(--t-grey200, #e5e8eb);
    padding:0;
    margin-top:0;
}
.estimate-wrapper .section-box.est-basic{
    border-top:0;
    padding:0 0 28px;
}
.estimate-wrapper .est-basic .form-section-head{ margin-bottom:20px; }

/* 섹션 머리줄: → 제목 ........ [0원] [펼치기] */
.estimate-wrapper .section-toggle{ padding:18px 0; }
.estimate-wrapper .section-toggle .left{ padding-left:0; }
.estimate-wrapper .section-toggle .left::before{ display:none; }
.estimate-wrapper .section-toggle .left .title{
    font-size:16px;
    font-weight:700;
    color:var(--t-grey900, #191f28);
    letter-spacing:-0.02em;
}
/* 접혀 있을 때만 → 표시 */
.estimate-wrapper .section-toggle[aria-expanded="false"] .left .title::before{
    content:"→";
    margin-right:10px;
    font-weight:500;
    color:var(--t-grey700, #4e5968);
}
.estimate-wrapper .section-toggle .right{ min-width:0; gap:8px; }
.estimate-wrapper .section-toggle .mini-total{
    height:30px;
    min-width:84px;
    padding:0 12px;
    border:0;
    border-radius:6px;
    background:var(--t-blue-light, #e8f3ff);
    color:var(--t-blue, #3182f6);
    font-size:12.5px;
    font-weight:600;
}
.estimate-wrapper .toggle-text{
    height:32px;
    min-width:56px;
    padding:0 12px;
    border:1px solid var(--t-grey200, #e5e8eb);
    border-radius:8px;
    background:#fff;
    color:var(--t-grey800, #333d4b);
    font-size:12.5px;
    font-weight:500;
}
.estimate-wrapper .section-toggle:hover .toggle-text{ background:var(--t-grey50, #f9fafb); }

/* 펼친 내용 아래 여백 */
.estimate-wrapper .section-box > .collapse > :last-child,
.estimate-wrapper .section-box > .collapsing > :last-child{ margin-bottom:24px; }

.estimate-wrapper .hint-text{
    font-size:12.5px;
    color:var(--t-grey600, #6b7684);
    margin-bottom:10px;
}

/* 복붙 가져오기 / 텍스트 비우기 */
.estimate-wrapper .bulk-actions{ gap:8px; }
.estimate-wrapper .bulk-actions .btn-touch,
.estimate-wrapper .section-footer .btn-touch{
    height:36px;
    padding:0 14px;
    border-radius:8px;
    font-size:13px;
    font-weight:500;
}

/* + 항목 추가 (연파랑) */
.btn-add{
    --bs-btn-color: var(--t-blue, #3182f6);
    --bs-btn-bg: var(--t-blue-light, #e8f3ff);
    --bs-btn-border-color: var(--t-blue-light, #e8f3ff);
    --bs-btn-hover-color: var(--t-blue, #3182f6);
    --bs-btn-hover-bg: #d6e8ff;
    --bs-btn-hover-border-color: #d6e8ff;
    --bs-btn-active-color: var(--t-blue, #3182f6);
    --bs-btn-active-bg: #c4ddff;
    --bs-btn-active-border-color: #c4ddff;
    font-weight:600 !important;
}

/* 섹션 하단: [+ 항목 추가] ........ 철거 총합 0 원 */
.estimate-wrapper .section-footer{ margin-top:14px; }
.estimate-wrapper .total-chip{
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    gap:8px;
    align-items:baseline;
}
.estimate-wrapper .total-chip .label{
    font-size:12.5px;
    font-weight:500;
    color:var(--t-grey600, #6b7684);
}
.estimate-wrapper .total-chip .value{
    font-size:18px;
    font-weight:700;
    color:var(--t-blue, #3182f6);
}

/* 항목 줄 (JS가 그리는 .row) */
.estimate-wrapper .work-card-list > .row{
    border:1px solid var(--t-grey200, #e5e8eb);
    border-radius:10px;
    box-shadow:none;
}
.estimate-wrapper .work-card-list input[disabled]{ background:#f2f4f6 !important; }

/* 사진 / 영수증 미리보기 */
.estimate-wrapper .receipt-grid img,
.estimate-wrapper .receipt-thumb{ border-color:var(--t-grey200, #e5e8eb); border-radius:8px; }

/* ---------- 하단: 팀장 순이익 + 버튼 ---------- */
.estimate-wrapper #section_btn{ padding-top:20px; }
.estimate-wrapper .est-profit{
    display:flex;
    justify-content:flex-end;
    align-items:baseline;
    gap:10px;
}
.estimate-wrapper .est-profit .label{ font-size:13.5px; font-weight:500; color:var(--t-grey700, #4e5968); }
.estimate-wrapper .est-profit .value{ font-size:20px; font-weight:700; color:var(--t-blue, #3182f6); }
.estimate-wrapper .est-actions{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:8px;
    margin-top:16px;
    padding-bottom:8px;
}
.estimate-wrapper .est-actions .btn-touch{
    height:42px;
    min-width:88px;
    padding:0 16px;
    border-radius:8px;
    font-size:14px;
    font-weight:600;
}

/* 내부 인건비가 숨겨진 경우(관리자+품 아님) 청구 인건비 문구도 숨김 → 금액만 표시 (기존 동작) */
#labor_internal_total_wrap.d-none ~ .labor-charge .labor-charge-label{ display:none; }

@media (max-width:576px){
    .estimate-wrapper .section-toggle{ padding:14px 0; }
    .estimate-wrapper .section-toggle .left .title{ font-size:15px; }
    .estimate-wrapper .section-toggle .mini-total{ min-width:0; padding:0 8px; }
    /* 품 견적 인건비: 금액칩 문구가 길어 제목이 한 글자씩 세로로 꺾이던 문제
       → 제목은 한 줄 고정, 금액칩이 남는 폭 안에서 줄바꿈 */
    .estimate-wrapper .section-toggle .left{ flex:0 0 auto; }
    .estimate-wrapper .section-toggle .left .title{ white-space:nowrap; }
    .estimate-wrapper .section-toggle .right{ flex:1 1 auto; min-width:0; }
    .estimate-wrapper .section-toggle .mini-total{ height:auto; min-height:30px; padding:4px 8px; line-height:1.4; }
    /* 인건비 칩: 모바일에서는 내부 인건비 / 청구 인건비+금액 두 줄로 */
    .estimate-wrapper .section-toggle .labor-mini{ flex-direction:column; align-items:flex-end; }
    .estimate-wrapper .section-toggle .labor-mini .labor-sep{ display:none; }
    .estimate-wrapper .est-actions .btn-touch{ flex:1 1 calc(50% - 4px); min-width:0; }
}
