/* ============================================
   DailyData - Soft UI Card Style
   AdminLTE 베이스 + 커스텀 오버라이드
   ============================================ */

/* 다크모드 무시 - 항상 라이트 테마 강제 */
:root {
    color-scheme: light only;
}

/* 전역 */
html, body {
    background-color: #f4f6f9 !important;
    color: #344767;
}
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f4f6f9;
}

/* 사용자 OS가 다크모드여도 라이트 색상 유지 */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #f4f6f9 !important;
        color: #344767 !important;
    }
    .card, .card-soft {
        background-color: #ffffff !important;
        color: #344767 !important;
    }
    input, select, textarea {
        background-color: #ffffff !important;
        color: #344767 !important;
    }
}

/* 아이콘-텍스트 간격 전역 */
i.fas,
i.far,
i.fab {
    margin-right: 8px !important;
}

/* AdminLTE card-title float:left 강제 해제 */
.card-title {
    float: none !important;
}

/* Bootstrap 5 me-* / ms-* 클래스 (AdminLTE 3.2 = Bootstrap 4 기반이라 없음) */
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

/* AdminLTE 사이드바 마진 리셋 (사이드바 미사용) */
body:not(.sidebar-mini) .content-wrapper,
body.sidebar-collapse .content-wrapper {
    margin-left: 0 !important;
}

.content-wrapper {
    min-height: calc(100vh - 57px);
    padding-bottom: 2rem;
}

/* 데스크톱 콘텐츠 max-width 제한 */
.container-fluid.px-4 {
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- 데스크톱 상단 Navbar ---- */
.desktop-nav {
    border-bottom: none;
    background: #f0f1ff;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #5e72e4, #825ee4) 1;
}

.mobile-nav {
    display: none;
    border-bottom: none;
    background: #f0f1ff;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #5e72e4, #825ee4) 1;
}

.mobile-nav .container-fluid {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
}

.mobile-nav .navbar-brand {
    margin-right: 0 !important;
    flex-grow: 0 !important;
}

.mobile-nav .settings-btn {
    margin-left: auto !important;
}

.main-header .navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #344767;
}

.main-header .nav-link.tab-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #67748e;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin: 0 0.15rem;
}

.main-header .nav-link.tab-link:hover {
    color: #344767;
    background: #f0f2f5;
}

.main-header .nav-link.tab-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #5e72e4, #825ee4);
    box-shadow: 0 3px 10px rgba(94, 114, 228, 0.3);
}

/* ---- 하단 탭바 (모바일) ---- */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #f0f1ff;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, #5e72e4, #825ee4) 1;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 0;
    color: #8392ab;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: color 0.2s;
    gap: 2px;
}

.bottom-tab i {
    font-size: 1.15rem;
}

.bottom-tab.active {
    color: #5e72e4;
    font-weight: 600;
}

.bottom-tab:hover {
    color: #5e72e4;
    text-decoration: none;
}

/* ---- 홈 히어로 배너 ---- */
.hero-banner {
    background: linear-gradient(135deg, #5e72e4, #825ee4, #5e72e4);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    padding: 2rem 0 1.5rem;
    color: #fff;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-greeting {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #fff;
}

.hero-sub {
    font-size: 0.88rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.85);
}

.hero-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    animation: heroFloat 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- 탭 섹션 제목 ---- */
.tab-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #344767;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.tab-section-title i {
    margin-right: 0.4rem;
}

/* ---- Soft UI 카드 ---- */
.card-soft {
    border: none;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-soft:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-soft .card-header {
    background: transparent;
    padding: 1rem 1.25rem 0.5rem;
}

.card-soft .card-body {
    padding: 1.25rem 1.5rem;
}

/* ---- 서비스 카드 (그룹 내 목록) ---- */
.service-card {
    cursor: pointer;
    margin-bottom: 1.25rem;
    border-left: 4px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card.accent-warning  { --card-accent: #f5365c; }
.service-card.accent-info     { --card-accent: #11cdef; }
.service-card.accent-success  { --card-accent: #2dce89; }
.service-card.accent-primary  { --card-accent: #5e72e4; }
.service-card.accent-danger   { --card-accent: #f5365c; }
.service-card.accent-secondary { --card-accent: #8392ab; }

.service-card:hover {
    border-left-color: var(--card-accent, #5e72e4);
}

.service-card .card-body {
    padding: 1.1rem 1.25rem;
}

.service-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    margin-right: 1rem;
    transition: transform 0.3s ease;
}

.service-card:hover .card-icon {
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* 카드 chevron 이동 애니메이션 */
.service-card .fa-chevron-right {
    transition: transform 0.25s ease;
}

.service-card:hover .fa-chevron-right {
    transform: translateX(4px);
}

/* 공통 gradient + accent 변수 (카드 아이콘, 설정 아이콘, 최근 목록 아이콘) */
.bg-gradient-warning { background: linear-gradient(135deg, #f5365c, #f56036) !important; --card-accent: #f5365c; }
.bg-gradient-info { background: linear-gradient(135deg, #11cdef, #1171ef) !important; --card-accent: #11cdef; }
.bg-gradient-success { background: linear-gradient(135deg, #2dce89, #2dcecc) !important; --card-accent: #2dce89; }
.bg-gradient-primary { background: linear-gradient(135deg, #5e72e4, #825ee4) !important; --card-accent: #5e72e4; }
.bg-gradient-danger { background: linear-gradient(135deg, #f5365c, #f56036) !important; --card-accent: #f5365c; }
.bg-gradient-secondary { background: linear-gradient(135deg, #8392ab, #8392d4) !important; --card-accent: #8392ab; }

.service-card .card-info {
    flex: 1;
    min-width: 0;
}

.service-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #344767;
    margin-bottom: 0.3rem;
}

.service-card .card-text {
    font-size: 0.8rem;
    color: #67748e;
    margin-bottom: 0;
    line-height: 1.4;
}

.service-card .fa-chevron-right {
    margin-left: 0.75rem;
}

/* ---- 탭 카드 (풀와이드) ---- */
.tab-card {
    margin-bottom: 1rem;
}

.tab-card .card-body {
    padding: 1.4rem 1.5rem;
}

.tab-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    font-size: 1.5rem;
}

/* 상태 텍스트 */
.card-status {
    display: inline-block;
    font-size: 0.7rem;
    color: #8392ab;
    margin-top: 0.35rem;
}

.card-status i {
    margin-right: 0.2rem;
    font-size: 0.6rem;
}

/* 하단 안내 배너 */
.tab-info-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem;
    background: rgba(94, 114, 228, 0.06);
    border-radius: 0.75rem;
    color: #8392ab;
    font-size: 0.78rem;
}

.tab-info-banner i {
    color: #5e72e4;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---- 최근 본 서비스 리스트 ---- */
.recent-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s, transform 0.2s ease;
    opacity: 0;
    animation: cardSlideUp 0.3s ease-out forwards;
}

.recent-item:hover {
    background: #f0f2f5;
}

.recent-item .recent-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    margin-right: 0.85rem;
    flex-shrink: 0;
}

.recent-item .recent-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #344767;
}

.recent-item .recent-time {
    font-size: 0.7rem;
    color: #8392ab;
    margin-left: auto;
}

/* ---- 방문 통계 차트 영역 ---- */
#visitChart {
    max-height: 200px;
}

/* ---- 상세 페이지 ---- */
#page-detail .card-body {
    min-height: auto;
}

/* ---- 뒤로 버튼 ---- */
.btn-outline-secondary {
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

/* ---- 콘텐츠 헤더 ---- */
.content-header h4 {
    font-weight: 700;
    color: #344767;
}

/* ---- 데이터 소스 배너 ---- */
.data-source-banner {
    font-size: 0.73rem;
    color: #888;
    padding: 4px 0 8px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.data-source-banner .banner-icon {
    font-size: 0.7rem;
    margin-right: 0 !important;
}
.data-source-banner .banner-sep {
    color: #bbb;
}

/* ---- 설정 버튼 (톱니바퀴) ---- */
.test-btn {
    padding: 0.5rem 0.65rem;
    font-size: 1.1rem;
    color: #8392ab;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.test-btn:hover,
.test-btn.active {
    color: #f5365c;
    background: #f0f2f5;
}

.settings-btn {
    padding: 0.5rem 0.65rem;
    font-size: 1.1rem;
    color: #67748e;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.settings-btn:hover,
.settings-btn.active {
    color: #5e72e4;
    background: #f0f2f5;
}

/* ---- 모바일 뒤로 버튼 (mobile-nav 내부) ---- */
.btn-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    color: #344767;
    font-size: 1.1rem;
    margin-left: -0.25rem;
    margin-right: 0.5rem;
    transition: all 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-mobile-back:hover {
    color: #5e72e4;
    background: #f0f2f5;
}

.btn-mobile-back:active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

/* ---- 설정 페이지 ---- */
.settings-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #344767;
    margin-bottom: 0.5rem;
}

.settings-section-title i {
    margin-right: 0.4rem;
}

/* 전체 선택/해제 바 */
.select-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 0.5rem;
}

.select-all-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #5e72e4;
}

.select-all-bar .btn {
    border-radius: 0.4rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

/* 그룹 라벨 (선택됨/미선택) */
.settings-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8392ab;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
}

/* 토글 아이템 */
.settings-toggle-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.settings-toggle-item:last-child {
    border-bottom: none;
}

.settings-toggle-item.compact {
    padding: 0.5rem 0;
}

.settings-toggle-item.compact .toggle-desc {
    display: none;
}

/* 작은 아이콘 (설정용) */
.card-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.settings-toggle-item.compact .card-icon-sm {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    border-radius: 0.4rem;
}

.toggle-info {
    flex: 1;
    min-width: 0;
}

.toggle-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #344767;
}

.settings-toggle-item.compact .toggle-name {
    font-size: 0.82rem;
    color: #67748e;
}

.toggle-desc {
    display: block;
    font-size: 0.75rem;
    color: #8392ab;
    margin-top: 0.1rem;
}

/* Bootstrap 스위치 커스텀 */
.form-check-input {
    width: 2.75rem;
    height: 1.4rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #5e72e4;
    border-color: #5e72e4;
}

/* 저장된 설정값 — 읽기 전용 */
.saved-setting-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s;
}

.saved-setting-item:last-child {
    border-bottom: none;
}

.saved-setting-item:active {
    background: #f8f9ff;
}

.saved-setting-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.saved-setting-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 10px;
    flex-shrink: 0;
}

.saved-setting-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #344767;
}

.saved-setting-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 40px;
}

.saved-setting-tag {
    display: inline-block;
    background: #f0f2f5;
    color: #344767;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}

.saved-setting-empty {
    font-size: 0.75rem;
    color: #adb5bd;
    font-style: italic;
}

/* 기타 설정 */
.other-setting-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.other-setting-item:last-child {
    border-bottom: none;
}

.other-setting-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #344767;
}

.other-setting-desc {
    display: block;
    font-size: 0.75rem;
    color: #8392ab;
    margin-top: 0.1rem;
}

/* ============================================
   상세 페이지 스켈레톤
   ============================================ */

/* 공통 스켈레톤 라인 */
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.w-15 { width: 15%; }
.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-65 { width: 65%; }
.skeleton-line.w-70 { width: 70%; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 리스트형 스켈레톤 */
.skeleton-list-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

/* 차트형 스켈레톤 */
.skeleton-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    padding: 0 0.5rem;
}

.skeleton-chart-bar {
    width: 10%;
    background: linear-gradient(90deg, #e8eaed 25%, #dde0e4 50%, #e8eaed 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px 6px 0 0;
}

/* 테이블형 스켈레톤 */
.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.skeleton-table-row.header {
    background: #f8f9fa;
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

/* 지도형 스켈레톤 */
.skeleton-map {
    height: 250px;
    background: linear-gradient(135deg, #e8eaed, #f0f2f5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8392ab;
    font-size: 0.85rem;
    border-radius: 0 0 1rem 1rem;
}

.skeleton-map i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* ---- 빈 상태 메시지 ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #8392ab;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   터치 UX / 애니메이션
   ============================================ */

/* 카드 터치 press 피드백 */
.service-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.1s, box-shadow 0.1s;
}

.recent-item:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.bottom-tab:active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

/* 페이지 전환 */
.page-section {
    animation: pageSlideIn 0.3s ease-out;
}

@keyframes pageSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 카드 순차 등장 (stagger) */
.service-card {
    opacity: 0;
    animation: cardSlideUp 0.35s ease-out forwards;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- 관리자 페이지 ---- */
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f5365c, #f56036);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* 스케줄러 수집 현황 */
.scheduler-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .scheduler-grid { grid-template-columns: repeat(3, 1fr); }
}

.scheduler-card {
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.scheduler-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.scheduler-card.scheduler-ok { border-left: 3px solid #27ae60; }
.scheduler-card.scheduler-warn { border-left: 3px solid #f39c12; }
.scheduler-card.scheduler-error { border-left: 3px solid #e74c3c; }
.scheduler-card.scheduler-idle { border-left: 3px solid #bdc3c7; }

.scheduler-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.scheduler-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #344767;
}
.scheduler-status-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.scheduler-status-badge.scheduler-ok { background: #d4edda; color: #155724; }
.scheduler-status-badge.scheduler-warn { background: #fff3cd; color: #856404; }
.scheduler-status-badge.scheduler-error { background: #f8d7da; color: #721c24; }
.scheduler-status-badge.scheduler-idle { background: #e9ecef; color: #6c757d; }

.scheduler-card-body {
    margin-bottom: 8px;
}
.scheduler-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    padding: 2px 0;
}
.scheduler-card-footer .btn {
    border-radius: 6px;
}

.admin-api-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.admin-api-item:last-child {
    border-bottom: none;
}

.admin-api-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 0.85rem;
}

.admin-api-dot.status-ok { background: #2dce89; }
.admin-api-dot.status-fail { background: #f5365c; }
.admin-api-dot.status-error { background: #f5365c; }
.admin-api-dot.status-wait { background: #8392ab; }

.admin-api-info {
    flex: 1;
    min-width: 0;
}

.admin-api-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #344767;
}

.admin-api-time {
    font-size: 0.7rem;
    color: #8392ab;
}

.admin-api-btn {
    margin-left: auto;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-stat-card {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
}

.admin-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #344767;
}

.admin-stat-label {
    font-size: 0.7rem;
    color: #8392ab;
    margin-top: 0.2rem;
}

/* 설정 토글 아이템 터치 */
.settings-toggle-item:active {
    background: #f8f9fa;
}

/* ---- 마이크로 인터랙션 ---- */
/* 톱니바퀴 회전 */
.settings-btn:active i {
    animation: gearSpin 0.4s ease-out;
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(90deg); }
}

/* 뒤로 버튼 nudge */
.btn-mobile-back:active i {
    animation: backNudge 0.25s ease-out;
}

@keyframes backNudge {
    0%   { transform: translateX(0); }
    40%  { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* 하단 탭 dot indicator */
.bottom-tab.active::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #5e72e4;
    margin-top: 2px;
    animation: dotAppear 0.3s ease-out;
}

@keyframes dotAppear {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================================
   반응형: 모바일 (768px 이하)
   ============================================ */
@media (max-width: 768px) {
    /* 상단 데스크톱 네비 숨김, 모바일 네비 표시 */
    .desktop-nav {
        display: none !important;
    }

    .mobile-nav {
        display: flex !important;
    }

    /* 하단 탭바 표시 */
    .bottom-tab-bar {
        display: flex;
    }

    /* 하단 탭 공간 확보 */
    .content-wrapper {
        padding-bottom: 70px;
    }

    .content-header h4 {
        font-size: 1.15rem;
    }

    .service-card .card-icon {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
        margin-right: 0.85rem;
    }

    .hero-greeting {
        font-size: 1.2rem;
    }

    .hero-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .tab-card .card-body {
        padding: 1.2rem 1.1rem;
    }
}

/* ============================================
   API 테스트 페이지
   ============================================ */
.text-purple { color: #7c3aed; }

.test-result {
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid;
}

.test-result-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.test-result-fail {
    background: #fef2f2;
    border-color: #fecaca;
}

.test-result-pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    max-height: 300px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   Step 6: 비주얼 폴리싱 + 모바일 최적화
   ============================================ */

/* 데이터 테이블 통일 스타일 */
.table-sm th {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    padding: 0.5rem 0.4rem;
}
.table-sm td {
    font-size: 0.78rem;
    padding: 0.45rem 0.4rem;
    vertical-align: middle;
}
.table-light th {
    background-color: #f8f9fe !important;
    border-bottom: 2px solid #e9ecef;
}

/* 검색 영역 카드 통일 */
.card-soft .form-control-sm,
.card-soft .form-select-sm {
    border-radius: 0.5rem;
    border-color: #e0e3eb;
    font-size: 0.82rem;
}
.card-soft .form-control-sm:focus,
.card-soft .form-select-sm:focus {
    border-color: #5e72e4;
    box-shadow: 0 0 0 0.15rem rgba(94,114,228,0.15);
}

/* 테이블 가로 스크롤 힌트 */
.table-responsive {
    position: relative;
}
.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.table-responsive.is-scrollable::after {
    opacity: 1;
}

/* 버튼/터치 영역 최소 44px */
.btn-sm {
    min-height: 36px;
    min-width: 36px;
}
@media (max-width: 768px) {
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.4rem 0.75rem;
    }
    .form-select-sm, .form-control-sm {
        min-height: 40px;
        font-size: 16px !important; /* iOS zoom 방지 */
    }
    .table-sm th, .table-sm td {
        font-size: 0.72rem;
        padding: 0.35rem 0.3rem;
    }
}

/* 빈 상태/에러 상태 통일 */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #8898aa;
}
.empty-state i {
    font-size: 2rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 0.5rem;
}

/* 주유소 활성 뷰 버튼 */
.gas-view-btn.active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* 복지 카테고리 활성 버튼 */
#welfareCategoryBtns .btn.active {
    font-weight: 600;
}

/* 차트 모바일 최적화 */
@media (max-width: 576px) {
    canvas {
        max-height: 200px;
    }
}

/* 공기질 등급별 행동 안내 */
.alert.py-2.small {
    font-size: 0.78rem;
    border-radius: 0.5rem;
}

/* 데스크톱 검색 영역 최대 너비 제한 */
@media (min-width: 768px) {
    #airStationInput,
    #welfareSearchInput {
        max-width: 360px;
    }
}

/* ============================================
   Step 7: 좁은 모바일 화면 (≤480px) 레이아웃 최적화
   ============================================ */

/* 가로 오버플로우 차단 (전역) */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* 한글 제목 음절 단위 끊김 방지 */
.card-title,
.content-header h4,
h1, h2, h3, h4, h5, h6 {
    word-break: keep-all;
}

@media (max-width: 480px) {
    /* 컨테이너 좌우 여백 최소화 → 카드 폭 최대화 */
    .container-fluid.px-4,
    .container-fluid.px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .px-4.pt-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    /* content-header 자체 padding 제거 (내부 container-fluid.px-4가 이미 0.5rem 적용) */
    .content-header {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* ─────────────────────────────────────────────
       카드는 화면에 붙어있어도 OK,
       그러나 카드 바깥의 모든 텍스트/아이콘은
       왼쪽 가장자리에 붙지 않도록 12px 패딩 강제.
       ───────────────────────────────────────────── */
    .content-header h1,
    .content-header h2,
    .content-header h3,
    .content-header h4,
    .content-header h5,
    .content-header h6 {
        padding-left: 12px !important;
    }

    /* 홈 페이지 섹션 레이블 (자주 찾는 서비스, 최근 본 서비스) */
    #frequentLabel,
    #page-home .col-lg-8 > h6,
    #page-home .col-lg-4 > h6 {
        padding-left: 12px !important;
    }

    /* 생활정보/부동산/복지·교육 탭 섹션 타이틀 */
    .tab-section-title {
        padding-left: 12px !important;
    }

    /* 히어로 배너 내부 텍스트 (좋은 오후예요! / 필요한 정보를...) */
    .hero-banner .hero-text {
        padding-left: 12px;
    }

    /* 데이터 소스 배너: 두 줄로 스택 + 좌측 12px 여유 */
    .data-source-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        padding: 4px 0 8px 12px !important;
    }
    .data-source-banner .banner-sep {
        display: none !important;
    }

    /* 카드 내부 여백 축소 */
    .card-soft .card-body {
        padding: 1rem 1rem;
    }
    .card-soft .card-header {
        padding: 0.85rem 1rem 0.4rem;
    }

    /* 카드 헤더: 제목 + 드롭다운 flex 정리 */
    .card-soft .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    /* 카드 헤더 제목: 남은 공간 차지 + 축소 허용 */
    .card-soft .card-header h6.card-title {
        font-size: 0.88rem;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    /* 헤더 안 드롭다운: 축소 방지 + 컴팩트 */
    .card-soft .card-header .form-select-sm {
        flex: 0 0 auto;
        width: auto !important;
        max-width: 45%;
        min-height: 34px !important;
        font-size: 0.78rem !important;
        padding: 0.2rem 1.4rem 0.2rem 0.5rem !important;
    }

    /* 주유소 뷰 버튼 3개: 한 줄에 균등 배치 */
    .gas-view-btn {
        flex: 1 1 0;
        min-width: 0 !important;
        padding: 0.55rem 0.3rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
    }
    .gas-view-btn i {
        margin-right: 4px !important;
    }

    /* 버튼 그룹 컨테이너: 전체 폭 사용 + gap 축소 */
    .card-soft .card-body > .d-flex.flex-wrap {
        flex-wrap: nowrap !important;
        gap: 0.4rem !important;
        width: 100%;
    }

    /* 테이블 컬럼 패딩 더 축소 */
    .table-sm th, .table-sm td {
        padding: 0.3rem 0.25rem;
    }

    /* 데이터 소스 배너 여백 */
    .content-header {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* 아주 좁은 화면 (≤360px, 갤럭시S 기본 등) */
@media (max-width: 360px) {
    .container-fluid.px-4,
    .container-fluid.px-3 {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    .card-soft .card-body {
        padding: 0.85rem 0.8rem;
    }
    .card-soft .card-header {
        padding: 0.75rem 0.8rem 0.35rem;
    }
    .card-soft .card-header h6.card-title {
        font-size: 0.82rem;
    }
    .gas-view-btn {
        font-size: 0.72rem !important;
        padding: 0.5rem 0.2rem !important;
    }
    .gas-view-btn i {
        display: none;
    }
    .table-sm th, .table-sm td {
        font-size: 0.68rem;
    }
}
