/* ====================================================================
   SecureWatch Dashboard — Main Stylesheet v1.0
   디자인 시안 기반 | 다크/라이트 모드 | 반응형
   ==================================================================== */

/* ── Google Fonts 임포트 ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

/* ── CSS 변수 (라이트 모드 기본) ─────────────────────────────────── */
:root {
    --primary:        #0f172a;
    --primary-light:  #1e293b;
    --secondary:      #0058be;
    --secondary-hover:#0047a0;
    --error:          #ba1a1a;
    --error-bg:       #fff0f0;
    --warning:        #f59e0b;
    --warning-bg:     #fffbeb;
    --success:        #16a34a;
    --success-bg:     #f0fdf4;
    --info:           #0ea5e9;
    --info-bg:        #f0f9ff;

    --bg-color:       #f8fafc;
    --surface:        #ffffff;
    --surface-alt:    #f1f5f9;
    --border:         #e2e8f0;
    --border-focus:   #0058be;

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;

    --sidebar-bg:     #ffffff;
    --sidebar-width:  260px;
    --header-height:  64px;
    --card-radius:    12px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:      0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:      0 8px 30px rgba(0,0,0,.12);
    --transition:     all .2s ease;
}

/* ── 다크 모드 ────────────────────────────────────────────────────── */
.dark {
    --bg-color:       #0f172a;
    --surface:        #1e293b;
    --surface-alt:    #334155;
    --border:         #334155;

    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;

    --sidebar-bg:     #1e293b;
    --error-bg:       rgba(186,26,26,.15);
    --warning-bg:     rgba(245,158,11,.12);
    --success-bg:     rgba(22,163,74,.12);
    --info-bg:        rgba(14,165,233,.12);
    --shadow-sm:      0 1px 3px rgba(0,0,0,.3);
    --shadow-md:      0 4px 12px rgba(0,0,0,.3);
    --shadow-lg:      0 8px 30px rgba(0,0,0,.4);
}

/* ── 기본 리셋 ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background .25s, color .25s;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ── 스크롤바 스타일 ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Material Symbols ─────────────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    font-size: 20px;
}

/* ====================================================================
   레이아웃
   ==================================================================== */
.layout { display: flex; min-height: 100vh; }

/* ── 사이드바 ─────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    transition: var(--transition), transform .3s ease;
}

.sidebar-logo {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.sidebar-logo p {
    font-size: 14px;
    color: var(--text-muted);
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: var(--transition);
}
.nav-item:hover { background: var(--surface-alt); color: var(--text-primary); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item.active .material-symbols-outlined { color: #fff; }

.nav-badge {
    margin-left: auto;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }

.emergency-btn {
    width: 100%;
    background: var(--error);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: var(--transition);
}
.emergency-btn:hover { background: #9b1515; transform: translateY(-1px); }

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.user-info:hover { background: var(--surface-alt); }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0058be, #0ea5e9);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.user-name  { font-size: 14px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* ── 햄버거 (모바일) ─────────────────────────────────────────────── */
.hamburger {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

/* ── 사이드바 오버레이 (모바일) ──────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── 메인 콘텐츠 영역 ─────────────────────────────────────────────── */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── 헤더 ─────────────────────────────────────────────────────────── */
.header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0; z-index: 50;
    transition: var(--transition);
}

.header-tabs { display: flex; gap: 4px; }
.header-tab {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.header-tab:hover { color: var(--text-primary); }
.header-tab.active { color: var(--secondary); border-bottom-color: var(--secondary); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.btn-refresh {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-refresh:hover { background: var(--secondary-hover); }
.btn-refresh.loading { opacity: .7; pointer-events: none; }

.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text-primary); }

.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* ── 콘텐츠 ───────────────────────────────────────────────────────── */
.content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); }
.page-actions { display: flex; gap: 10px; }

/* ====================================================================
   카드 컴포넌트
   ==================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 24px;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── 요약 카드 그리드 ─────────────────────────────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.summary-card {
    padding: 22px 24px;
    border-radius: var(--card-radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.sc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.sc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.sc-icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
}
.sc-value {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1;
}
.sc-value span { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.sc-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── 서버 카드 그리드 ─────────────────────────────────────────────── */
.server-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.server-card {
    padding: 18px 20px;
    border-radius: var(--card-radius);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}
.server-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.server-card.critical { border-left-color: var(--error); }
.server-card.warning  { border-left-color: var(--warning); }
.server-card.normal   { border-left-color: var(--success); }
.server-card.offline  { border-left-color: var(--text-muted); opacity: .6; }

.sc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.sc-name  { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.sc-pulse { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pulse-on  { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.2); animation: pulse 2s infinite; }
.pulse-off { background: var(--text-muted); }
@keyframes pulse { 0%,100%{ box-shadow:0 0 0 0 rgba(22,163,74,.4)} 50%{box-shadow:0 0 0 6px rgba(22,163,74,0)} }

.metric-row { margin-bottom: 10px; }
.metric-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}
.metric-info .val { font-weight: 600; color: var(--text-primary); }
.metric-info .val.danger { color: var(--error); }
.metric-info .val.warn   { color: var(--warning); }

.progress {
    height: 5px;
    background: var(--surface-alt);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--secondary);
    transition: width .6s ease;
}
.progress-fill.red    { background: var(--error); }
.progress-fill.amber  { background: var(--warning); }
.progress-fill.green  { background: var(--success); }
.progress-fill.muted  { background: var(--text-muted); }

/* ── 경보 카드 ────────────────────────────────────────────────────── */
.alerts-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 28px;
}
.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.alerts-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.alerts-link  { font-size: 14px; color: var(--secondary); font-weight: 600; }

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    gap: 12px;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--surface-alt); }

.alert-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.alert-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.icon-critical { background: var(--error-bg); color: var(--error); }
.icon-warning  { background: var(--warning-bg); color: var(--warning); }
.icon-info     { background: var(--info-bg); color: var(--info); }
.icon-success  { background: var(--success-bg); color: var(--success); }

.alert-text { min-width: 0; }
.alert-msg  { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-meta { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.alert-srv  { color: var(--secondary); font-weight: 600; }

.alert-btns { display: flex; gap: 8px; flex-shrink: 0; }

/* ====================================================================
   배지 & 상태 태그
   ==================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}
.badge-error   { background: var(--error-bg);   color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: #e2e8f0; color: #475569; }
.badge-notice  { background: #f3e8ff; color: #7c3aed; }

/* 다크모드 뱃지 */
.dark .badge-muted   { background: rgba(255,255,255,.15); color: rgba(255,255,255,.75); }
.dark .badge-notice  { background: rgba(124,58,237,.2); color: #c4b5fd; }
.dark .badge-warning { background: rgba(245,158,11,.15); color: #fcd34d; }
.dark .badge-success { background: rgba(22,163,74,.15);  color: #4ade80; }
.dark .badge-info    { background: rgba(59,130,246,.15); color: #93c5fd; }

/* ── 위험도별 뱃지 (이미지의 색상 기준) ─────────────────────────── */
/* Critical: 빨강 */
.badge-critical { background: #ba1a1a; color: #fff; }
/* High: 주황 */
.badge-high     { background: #ea580c; color: #fff; }
/* Medium: 노랑 */
.badge-medium   { background: #ca8a04; color: #fff; }
/* Low: 초록 */
.badge-low      { background: var(--success-bg); color: var(--success); }

/* ── 위험도 아이콘 색상 ──────────────────────────────────────────── */
.level-critical { color: #ba1a1a; }   /* 🔴 */
.level-high     { color: #ea580c; }   /* 🟠 */
.level-medium   { color: #ca8a04; }   /* 🟡 */
.level-low      { color: #16a34a; }   /* 🟢 */
.level-info     { color: #64748b; }   /* ⚪ */

/* 다크모드 */
.dark .badge-critical { background: rgba(186,26,26,.8);  color: #fff; }
.dark .badge-high     { background: rgba(234,88,12,.8);  color: #fff; }
.dark .badge-medium   { background: rgba(202,138,4,.8);  color: #fff; }
.dark .badge-low      { background: rgba(22,163,74,.8);  color: #fff; }

/* ====================================================================
   버튼
   ==================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); }

.btn-primary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-primary:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); }

.btn-danger  { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #9b1515; }

.btn-sm { padding: 5px 11px; font-size: 14px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-alt); }

/* ====================================================================
   차트 섹션
   ==================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
}
.chart-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-wrap { position: relative; }

/* ====================================================================
   모달 (오른쪽 슬라이드)
   ==================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
}
.modal-overlay.open { display: flex; }

.modal-panel {
    width: 480px;
    max-width: 100vw;
    background: var(--surface);
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal-panel { transform: translateX(0); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.modal-title  { font-size: 18px; font-weight: 700; }
.modal-close  {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover { background: var(--error-bg); color: var(--error); }
.modal-body   { padding: 22px 24px; flex: 1; }

/* ── 모달 내 메트릭 ─────────────────────────────────────────────── */
.detail-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.detail-metric:last-child { border-bottom: none; }
.dm-label { font-size: 14px; color: var(--text-secondary); }
.dm-value { font-size: 15px; font-weight: 700; }

.detail-section { margin-bottom: 22px; }
.detail-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ====================================================================
   테이블
   ==================================================================== */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-alt); }
td.td-bold { font-weight: 600; color: var(--text-primary); }

/* ====================================================================
   폼 요소
   ==================================================================== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.form-control:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(0,88,190,.1); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ====================================================================
   토스트 알림
   ==================================================================== */
.toast-wrap {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    min-width: 280px;
    animation: slideUp .3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
@keyframes slideUp { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }

/* ====================================================================
   로딩 스피너
   ==================================================================== */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--card-radius);
    z-index: 10;
}
.dark .loading-overlay { background: rgba(30,41,59,.6); }

/* ====================================================================
   빈 상태
   ==================================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .material-symbols-outlined { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ====================================================================
   필터 바
   ==================================================================== */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.filter-bar .form-control { width: auto; min-width: 140px; padding: 7px 11px; font-size: 14px; }

/* ====================================================================
   섹션 헤더
   ==================================================================== */
.section-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.section-title {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ====================================================================
   반응형
   ==================================================================== */
@media (max-width: 1280px) {
    .server-grid  { grid-template-columns: repeat(3, 1fr); }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
        z-index: 101;
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-left: 0; }
    .hamburger { display: flex; }
    .server-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    .content { padding: 20px 16px; }
    .header  { padding: 0 16px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .server-grid  { grid-template-columns: 1fr 1fr; gap: 12px; }
    .page-header  { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-actions { width: 100%; }
    .header-tabs  { display: none; }
    .modal-panel  { width: 100vw; }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .summary-grid { grid-template-columns: 1fr; }
    .server-grid  { grid-template-columns: 1fr; }
    .sc-value     { font-size: 24px; }
}

/* ====================================================================
   AOS 애니메이션 보완
   ==================================================================== */
[data-aos] { transition-property: opacity, transform; }

/* ====================================================================
   로그인 페이지 전용
   ==================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 26px; font-weight: 800; }
.login-logo p  { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ====================================================================
   유틸리티
   ==================================================================== */
.text-danger  { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-info    { color: var(--info) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.fs-mono { font-family: 'JetBrains Mono', monospace; }

.d-flex  { display: flex; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

.mb-0  { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }
.mt-12 { margin-top: 12px; }

.p-0 { padding: 0; }

.w-100 { width: 100%; }

/* ====================================================================
   툴팁 (sw-tooltip)
   ==================================================================== */
.sw-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}
.sw-tooltip-icon {
    font-size: 15px !important;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s;
    user-select: none;
}
.sw-tooltip-icon:hover { color: #ea580c; }
.sw-tooltip-box {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: #fff7ed;
    border: 1.5px dashed #ea580c;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: #9a3412;
    line-height: 1.8;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    font-weight: 400;
    min-width: 200px;
}
.sw-tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ea580c;
}
.sw-tooltip-wrap:hover .sw-tooltip-box,
.sw-tooltip-wrap.open .sw-tooltip-box {
    display: block;
}
/* 다크모드 */
.dark .sw-tooltip-box {
    background: #431407;
    color: #f8fafc;
    border-color: #ea580c;
}
.dark .sw-tooltip-box::after {
    border-top-color: #ea580c;
}
