/* ============================================================
   ISG dMRV 대시보드 — 전문 기관용 라이트 테마 v3.0
   (주)뫼비우스자원순환 | Pachama/Verra/SustainCERT 스타일
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. 디자인 토큰 (라이트 테마)
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper {
    /* 배경 레이어 */
    --bg: #FFFFFF;
    --bg-secondary: #F8FAFB;
    --bg-tertiary: #F1F5F9;

    /* 텍스트 */
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    /* 프라이머리 (그린 — 환경/지속가능) */
    --green: #059669;
    --green-light: #10B981;
    --green-dark: #047857;
    --green-bg: #ECFDF5;

    /* 세컨더리 (블루 — 신뢰) */
    --blue: #0284C7;
    --blue-light: #0EA5E9;
    --blue-dark: #0369A1;

    /* 틸 */
    --teal: #0D9488;

    /* 상태 색상 */
    --amber: #D97706;
    --amber-bg: #FFFBEB;
    --red: #DC2626;
    --red-bg: #FEF2F2;

    /* 테두리 */
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    /* 트랜지션 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* 기본 설정 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.isg-dmrv-wrapper * { box-sizing: border-box; }
.isg-dmrv-wrapper .mono {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}


/* ────────────────────────────────────────────────────────────
   2. 애니메이션 (최소한 — fadeIn만 유지)
   ──────────────────────────────────────────────────────────── */
@keyframes isgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.isg-dmrv-wrapper .fade-in {
    animation: isgFadeIn 0.3s ease forwards;
}

/* 모션 감소 설정 존중 */
@media (prefers-reduced-motion: reduce) {
    .isg-dmrv-wrapper .fade-in {
        animation: none !important;
        opacity: 1 !important;
    }
}


/* ────────────────────────────────────────────────────────────
   3. 헤더 & 네비게이션
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .header {
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.isg-dmrv-wrapper .header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    gap: 24px;
}

.isg-dmrv-wrapper .logo-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.isg-dmrv-wrapper .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10B981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    letter-spacing: -0.5px;
}

.isg-dmrv-wrapper .logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: var(--text);
}

.isg-dmrv-wrapper .logo-text a {
    color: var(--text);
    text-decoration: none;
}

.isg-dmrv-wrapper .logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 500;
}

/* 탭 네비게이션 */
.isg-dmrv-wrapper .tabs {
    display: flex;
    gap: 0;
    align-items: stretch;
    height: 100%;
}

.isg-dmrv-wrapper .tab-btn {
    padding: 0 18px;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: var(--text-muted);
    transition: color var(--transition-normal), border-color var(--transition-normal);
    white-space: nowrap;
    font-family: inherit;
    height: 60px;
    display: flex;
    align-items: center;
}

.isg-dmrv-wrapper .tab-btn a {
    color: inherit;
    text-decoration: none;
}

.isg-dmrv-wrapper .tab-btn:hover:not(.active) {
    color: var(--text-secondary);
}

.isg-dmrv-wrapper .tab-btn.active {
    color: var(--green);
    font-weight: 600;
    border-bottom-color: var(--green);
}

.isg-dmrv-wrapper .tab-btn.active a {
    color: var(--green);
}


/* ────────────────────────────────────────────────────────────
   4. 메인 레이아웃
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px 64px;
    position: relative;
}

.isg-dmrv-wrapper .view { display: none; opacity: 0; }
.isg-dmrv-wrapper .view.active {
    display: block;
    opacity: 1;
    animation: isgFadeIn 0.3s ease forwards;
}


/* ────────────────────────────────────────────────────────────
   5. KPI 카드 — 좌측 컬러 보더 + 클린 디자인
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.isg-dmrv-wrapper .stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 좌측 컬러 보더 */
.isg-dmrv-wrapper .stat-card.card-green { border-left: 4px solid var(--green); }
.isg-dmrv-wrapper .stat-card.card-blue { border-left: 4px solid var(--blue); }
.isg-dmrv-wrapper .stat-card.card-teal { border-left: 4px solid var(--teal); }
.isg-dmrv-wrapper .stat-card.card-amber { border-left: 4px solid var(--amber); }

.isg-dmrv-wrapper .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.isg-dmrv-wrapper .stat-value {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--text);
}

.isg-dmrv-wrapper .stat-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
    font-weight: 600;
    letter-spacing: 0;
}

.isg-dmrv-wrapper .stat-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}


/* ────────────────────────────────────────────────────────────
   6. 차트 섹션
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.isg-dmrv-wrapper .chart-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.isg-dmrv-wrapper .chart-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.isg-dmrv-wrapper .chart-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.isg-dmrv-wrapper .chart-last-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: var(--text);
}


/* ────────────────────────────────────────────────────────────
   7. 테이블 섹션
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .vehicle-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.isg-dmrv-wrapper .vehicle-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 타이틀 좌측 그린 바 */
.isg-dmrv-wrapper .vehicle-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--green);
    border-radius: 2px;
}

.isg-dmrv-wrapper .table-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.isg-dmrv-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.isg-dmrv-wrapper th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.isg-dmrv-wrapper td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text);
}

.isg-dmrv-wrapper tbody tr:hover td {
    background: #F0FDF4;
}

.isg-dmrv-wrapper tr:last-child td {
    border-bottom: none;
}


/* ────────────────────────────────────────────────────────────
   8. 하단 요약 카드
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.isg-dmrv-wrapper .summary-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 좌측 컬러 보더 */
.isg-dmrv-wrapper .summary-card.summary-green { border-left: 4px solid var(--green); }
.isg-dmrv-wrapper .summary-card.summary-amber { border-left: 4px solid var(--amber); }
.isg-dmrv-wrapper .summary-card.summary-red { border-left: 4px solid var(--red); }

.isg-dmrv-wrapper .summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.isg-dmrv-wrapper .summary-icon.icon-green {
    background: var(--green-bg);
    color: var(--green);
}

.isg-dmrv-wrapper .summary-icon.icon-amber {
    background: var(--amber-bg);
    color: var(--amber);
}

.isg-dmrv-wrapper .summary-icon.icon-red {
    background: var(--red-bg);
    color: var(--red);
}

.isg-dmrv-wrapper .summary-num {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--text);
}

.isg-dmrv-wrapper .summary-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* 프로그레스 바 */
.isg-dmrv-wrapper .summary-progress {
    width: 100%;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.isg-dmrv-wrapper .summary-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}


/* ────────────────────────────────────────────────────────────
   9. 폼 (데이터 입력)
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .form-container {
    max-width: 640px;
    margin: 0 auto;
}

.isg-dmrv-wrapper .form-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.isg-dmrv-wrapper .form-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.isg-dmrv-wrapper .form-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.isg-dmrv-wrapper .form-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.isg-dmrv-wrapper .form-label .req {
    color: var(--red);
}

.isg-dmrv-wrapper .form-input,
.isg-dmrv-wrapper .form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    outline: none;
    margin-bottom: 18px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.isg-dmrv-wrapper .form-input:focus,
.isg-dmrv-wrapper .form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.isg-dmrv-wrapper .form-input::placeholder {
    color: var(--text-muted);
}


/* ────────────────────────────────────────────────────────────
   10. 업로드 영역
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    transition: border-color var(--transition-normal), background var(--transition-normal);
}

.isg-dmrv-wrapper .upload-zone:hover {
    border-color: var(--green);
    background: var(--green-bg);
}

.isg-dmrv-wrapper .upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.isg-dmrv-wrapper .upload-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.isg-dmrv-wrapper .upload-sub {
    font-size: 12px;
    color: var(--text-muted);
}


/* ────────────────────────────────────────────────────────────
   11. 제출 버튼
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: var(--green);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition-fast);
}

.isg-dmrv-wrapper .btn-submit:hover {
    background: var(--green-dark);
}

.isg-dmrv-wrapper .btn-submit:active {
    background: #065F46;
}

.isg-dmrv-wrapper .btn-submit:disabled {
    background: #D1D5DB;
    color: #9CA3AF;
    cursor: not-allowed;
}

/* 성공 메시지 */
.isg-dmrv-wrapper .success-msg {
    display: none;
    text-align: center;
    padding: 40px 20px;
}


/* ────────────────────────────────────────────────────────────
   12. 서브 탭 (데이터 조회) — 필 스타일
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    width: fit-content;
}

.isg-dmrv-wrapper .sub-tab {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.isg-dmrv-wrapper .sub-tab:hover:not(.active) {
    color: var(--text-secondary);
}

.isg-dmrv-wrapper .sub-tab.active {
    background: var(--green);
    color: #fff;
}


/* ────────────────────────────────────────────────────────────
   13. 배지 — 검증 상태
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.isg-dmrv-wrapper .badge-verified {
    background: var(--green-bg);
    border: 1px solid #A7F3D0;
    color: var(--green);
}

.isg-dmrv-wrapper .badge-missing {
    background: var(--amber-bg);
    border: 1px solid #FDE68A;
    color: var(--amber);
}

.isg-dmrv-wrapper .badge-mismatch {
    background: var(--red-bg);
    border: 1px solid #FECACA;
    color: var(--red);
}

.isg-dmrv-wrapper .badge-excess {
    background: var(--amber-bg);
    border: 1px solid #FDE68A;
    color: var(--amber);
}


/* ────────────────────────────────────────────────────────────
   14. 로딩 상태
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .is-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.isg-dmrv-wrapper .is-loaded {
    opacity: 1;
    animation: isgFadeIn 0.3s ease forwards;
}


/* ────────────────────────────────────────────────────────────
   15. 푸터
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}


/* ────────────────────────────────────────────────────────────
   16. 필터 바
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .isg-filter-bar {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

.isg-dmrv-wrapper .isg-filter-bar input,
.isg-dmrv-wrapper .isg-filter-bar select {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 13px;
    color: var(--text);
}

.isg-dmrv-wrapper .isg-filter-bar input:focus,
.isg-dmrv-wrapper .isg-filter-bar select:focus {
    border-color: var(--green) !important;
    outline: none;
}

.isg-dmrv-wrapper .isg-filter-bar button {
    border-radius: 6px !important;
    font-weight: 600;
}


/* ────────────────────────────────────────────────────────────
   17. 페이지네이션
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .isg-pagination button {
    border-radius: 6px !important;
    font-family: inherit;
    font-weight: 600;
}

.isg-dmrv-wrapper .isg-pagination button:not(:disabled):hover {
    border-color: var(--green) !important;
    color: var(--green) !important;
}


/* ────────────────────────────────────────────────────────────
   18. 반응형 디자인
   ──────────────────────────────────────────────────────────── */

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    .isg-dmrv-wrapper .header-inner {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
    }

    .isg-dmrv-wrapper .tabs {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .isg-dmrv-wrapper .tabs::-webkit-scrollbar {
        display: none;
    }

    .isg-dmrv-wrapper .tab-btn {
        min-height: 44px;
        height: 44px;
        flex-shrink: 0;
        font-size: 13px;
    }

    .isg-dmrv-wrapper .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .isg-dmrv-wrapper .charts-row {
        grid-template-columns: 1fr;
    }

    .isg-dmrv-wrapper .summary-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .isg-dmrv-wrapper .main {
        padding: 20px 16px 40px;
    }

    .isg-dmrv-wrapper .form-card {
        padding: 24px 18px;
    }

    .isg-dmrv-wrapper .sub-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        width: auto;
    }

    .isg-dmrv-wrapper .sub-tabs::-webkit-scrollbar {
        display: none;
    }

    .isg-dmrv-wrapper .sub-tab {
        white-space: nowrap;
    }

    .isg-dmrv-wrapper .stat-value {
        font-size: 26px;
    }

    .isg-dmrv-wrapper .summary-num {
        font-size: 22px;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    .isg-dmrv-wrapper .stats-row {
        grid-template-columns: 1fr;
    }

    .isg-dmrv-wrapper .summary-row {
        grid-template-columns: 1fr;
    }

    .isg-dmrv-wrapper .stat-value {
        font-size: 24px;
    }

    .isg-dmrv-wrapper .summary-num {
        font-size: 20px;
    }

    .isg-dmrv-wrapper .form-card {
        padding: 20px 16px;
    }

    .isg-dmrv-wrapper .vehicle-section {
        padding: 16px;
    }

    .isg-dmrv-wrapper .stat-card {
        padding: 16px 18px;
    }
}


/* ────────────────────────────────────────────────────────────
   19. 유틸리티
   ──────────────────────────────────────────────────────────── */

/* 스크롤바 */
.isg-dmrv-wrapper .table-wrap::-webkit-scrollbar {
    height: 6px;
}

.isg-dmrv-wrapper .table-wrap::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.isg-dmrv-wrapper .table-wrap::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

/* 링크 */
.isg-dmrv-wrapper a {
    color: inherit;
    text-decoration: none;
}

/* 선택 */
.isg-dmrv-wrapper ::selection {
    background: rgba(5, 150, 105, 0.15);
    color: var(--text);
}

/* 사진 썸네일 (JS에서 주입하던 스타일을 CSS로 이관) */
.isg-dmrv-wrapper .dmrv-photo-thumb { display: inline-block; margin: 0 2px; }
.isg-dmrv-wrapper .dmrv-photo-thumb img {
    width: 32px; height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--border);
    transition: transform 0.15s, border-color 0.15s;
}
.isg-dmrv-wrapper .dmrv-photo-thumb:hover img {
    transform: scale(1.15);
    border-color: var(--green);
}


/* ────────────────────────────────────────────────────────────
   20. 다크/라이트 모드 토글 버튼
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper .theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.isg-dmrv-wrapper .theme-toggle:hover {
    border-color: var(--green);
}

.isg-dmrv-wrapper .theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.isg-dmrv-wrapper .theme-toggle .icon-sun,
.isg-dmrv-wrapper .theme-toggle .icon-moon {
    display: none;
}

/* 라이트 모드: 달 아이콘 표시 (다크모드로 전환 의미) */
.isg-dmrv-wrapper .theme-toggle .icon-moon { display: block; }
.isg-dmrv-wrapper .theme-toggle .icon-sun { display: none; }

/* 다크 모드: 해 아이콘 표시 (라이트모드로 전환 의미) */
.isg-dmrv-wrapper[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.isg-dmrv-wrapper[data-theme="dark"] .theme-toggle .icon-sun { display: block; }


/* ────────────────────────────────────────────────────────────
   21. 다크 모드 테마 변수 오버라이드
   ──────────────────────────────────────────────────────────── */
.isg-dmrv-wrapper[data-theme="dark"] {
    /* 배경 레이어 */
    --bg: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;

    /* 텍스트 */
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-dim: #94A3B8;

    /* 프라이머리 (그린 — 다크 배경용 밝기 조정) */
    --green: #10B981;
    --green-light: #34D399;
    --green-dark: #059669;
    --green-bg: rgba(16, 185, 129, 0.12);

    /* 세컨더리 (블루) */
    --blue: #0EA5E9;
    --blue-light: #38BDF8;
    --blue-dark: #0284C7;

    /* 틸 */
    --teal: #14B8A6;

    /* 상태 색상 (다크 배경용 조정) */
    --amber: #F59E0B;
    --amber-bg: rgba(245, 158, 11, 0.12);
    --red: #EF4444;
    --red-bg: rgba(239, 68, 68, 0.12);

    /* 테두리 */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
}

/* 다크 모드 트랜지션 (주요 요소에 적용) */
.isg-dmrv-wrapper,
.isg-dmrv-wrapper .header,
.isg-dmrv-wrapper .stat-card,
.isg-dmrv-wrapper .chart-card,
.isg-dmrv-wrapper .vehicle-section,
.isg-dmrv-wrapper .summary-card,
.isg-dmrv-wrapper .form-card,
.isg-dmrv-wrapper .form-input,
.isg-dmrv-wrapper .form-select,
.isg-dmrv-wrapper .upload-zone,
.isg-dmrv-wrapper .sub-tabs,
.isg-dmrv-wrapper .sub-tab,
.isg-dmrv-wrapper .table-wrap,
.isg-dmrv-wrapper th,
.isg-dmrv-wrapper td,
.isg-dmrv-wrapper .footer,
.isg-dmrv-wrapper .isg-filter-bar,
.isg-dmrv-wrapper .badge {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 다크 모드 — 개별 요소 오버라이드 */

/* 카드 그림자 */
.isg-dmrv-wrapper[data-theme="dark"] .stat-card,
.isg-dmrv-wrapper[data-theme="dark"] .chart-card,
.isg-dmrv-wrapper[data-theme="dark"] .vehicle-section,
.isg-dmrv-wrapper[data-theme="dark"] .summary-card,
.isg-dmrv-wrapper[data-theme="dark"] .form-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 테이블 행 호버 */
.isg-dmrv-wrapper[data-theme="dark"] tbody tr:hover td {
    background: rgba(16, 185, 129, 0.08);
}

/* 업로드 영역 호버 */
.isg-dmrv-wrapper[data-theme="dark"] .upload-zone:hover {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.08);
}

/* 업로드 아이콘 박스 */
.isg-dmrv-wrapper[data-theme="dark"] .upload-icon {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

/* 제출 버튼 비활성 상태 */
.isg-dmrv-wrapper[data-theme="dark"] .btn-submit:disabled {
    background: #334155;
    color: #64748B;
}

/* 배지 (다크 배경용 반투명 처리) */
.isg-dmrv-wrapper[data-theme="dark"] .badge-verified {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.isg-dmrv-wrapper[data-theme="dark"] .badge-missing,
.isg-dmrv-wrapper[data-theme="dark"] .badge-excess {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.isg-dmrv-wrapper[data-theme="dark"] .badge-mismatch {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* 토글 버튼 다크 모드 스타일 */
.isg-dmrv-wrapper[data-theme="dark"] .theme-toggle {
    background: var(--bg-secondary);
    border-color: var(--border);
}

/* 로고 아이콘 — 그라데이션 유지 */
.isg-dmrv-wrapper[data-theme="dark"] .logo-icon {
    background: linear-gradient(135deg, #10B981, #34D399);
}

/* 선택 영역 색상 */
.isg-dmrv-wrapper[data-theme="dark"] ::selection {
    background: rgba(16, 185, 129, 0.25);
}

/* 페이지네이션 버튼 다크 모드 */
.isg-dmrv-wrapper[data-theme="dark"] .isg-pagination button:not(:disabled):hover {
    border-color: var(--green) !important;
    color: var(--green) !important;
}

/* 서브 탭 활성 상태 */
.isg-dmrv-wrapper[data-theme="dark"] .sub-tab.active {
    background: var(--green);
    color: #fff;
}

/* 포커스 링 다크 모드 */
.isg-dmrv-wrapper[data-theme="dark"] .form-input:focus,
.isg-dmrv-wrapper[data-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 스크롤바 다크 모드 */
.isg-dmrv-wrapper[data-theme="dark"] .table-wrap::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.isg-dmrv-wrapper[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

