/* ══════════════════════════════════════════════════════════════
   BARO-AIR&LIGHT Design System (HD현대중공업 사무동)
   HD현대 CI: 그린 #127e3c · #20a543 · #57b43f / 네이비 #133378
   ══════════════════════════════════════════════════════════════ */

/* ── 폰트 (에이투지체) ── */
@font-face {
    font-family: 'ATOZ';
    src: url('/static/fonts/font-light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ATOZ';
    src: url('/static/fonts/font-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ── 디자인 토큰 (Light) ──
   HD현대 CI 그린 (로고 트라이앵글 3색 기반)
   Main: #127e3c  Sub: #20a543  Accent: #57b43f  Navy: #133378
   ────────────────────────────────────────────── */
:root {
    --primary-900: #0a3d1e;
    --primary-800: #0e5429;
    --primary-700: #106933;
    --primary-600: #127e3c;
    --primary-500: #20a543;
    --primary-400: #3db956;
    --primary-300: #57b43f;
    --primary-200: #a8dfa8;
    --primary-100: #d3f0d3;
    --primary-50:  #eef9ee;
    --hd-navy:     #133378;

    --success-700: #047857;
    --success-600: #059669;
    --success-100: #d1fae5;
    --success-50:  #ecfdf5;

    --error-700: #b91c1c;
    --error-600: #dc2626;
    --error-100: #fee2e2;
    --error-50:  #fef2f2;

    --warning-700: #b45309;
    --warning-600: #d97706;
    --warning-100: #fef3c7;
    --warning-50:  #fffbeb;

    --offline-600: #6b7280;
    --offline-100: #f3f4f6;
    --offline-50:  #f9fafb;

    --sidebar-w: 256px;
    --sidebar-collapsed: 72px;
    --topbar-h: 56px;
    --footer-h: 56px;

    --page-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --bg-secondary: #f8fafc;

    --font-body: 'ATOZ', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
}

/* ── 디자인 토큰 (Dark) ── */
html.dark {
    --page-bg: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --border-light: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-50: #0a2e18;
    --primary-100: #0e5429;
    --success-50: #064e3b;
    --success-100: #065f46;
    --error-50: #450a0a;
    --error-100: #7f1d1d;
    --warning-50: #451a03;
    --warning-100: #78350f;
    --offline-50: #1e293b;
    --offline-100: #334155;
    --bg-secondary: #334155;
}

/* ── 리셋 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--page-bg);
    color: var(--text-primary);
    min-height: 100vh;
    font-weight: 300;
    line-height: 1.6;
    font-size: 1rem;
}
html.dark body { background: var(--page-bg); color: var(--text-primary); }

/* ── 레이아웃 ── */
.layout { display: flex; min-height: 100vh; }

/* ── 사이드바 ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: width 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
    overflow-x: hidden;
}
html.dark .sidebar { background: #1e293b; border-color: #334155; }
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.sidebar-logo .logo-box {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    color: #fff; font-weight: 900; font-size: 1rem;
    position: relative; overflow: hidden;
}
.sidebar-logo .logo-box::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    animation: logoShine 4s infinite;
}
@keyframes logoShine {
    0%, 85%, 100% { left: -75%; opacity: 0; }
    90% { left: 125%; opacity: 1; }
}
.sidebar-logo .logo-text h1 {
    font-size: 0.9375rem; font-weight: 700;
    color: var(--text-primary); line-height: 1.2;
}
.sidebar-logo .logo-sub {
    font-size: 0.6875rem; color: var(--text-muted); line-height: 1.2;
}

/* 네비게이션 */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }
.nav-section {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 10px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    font-size: 0.9375rem; font-weight: 300;
    color: var(--text-secondary);
    text-decoration: none;
    border-right: 3px solid transparent;
    transition: all 0.18s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.nav-link:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}
.nav-link.active {
    background: var(--primary-50);
    color: var(--primary-700);
    border-right-color: var(--primary-500);
    font-weight: 500;
}
.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--primary-500);
    border-radius: 0 3px 3px 0;
}
.nav-link svg, .nav-link .nav-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    transition: transform 0.15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.nav-link:hover svg, .nav-link:hover .nav-icon { transform: scale(1.08); }

/* 사이드바 푸터 */
.sidebar-footer {
    height: var(--footer-h);
    padding: 0 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    color: var(--primary-700);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── 탑바 ── */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed; top: 0; left: var(--sidebar-w); right: 0;
    z-index: 30;
    transition: left 0.25s;
}
html.dark .topbar { background: rgba(30,41,59,0.92); }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

/* 실시간 시계 */
#live-clock {
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ── 티커 ── */
.ticker-wrap {
    flex: 1;
    margin: 0 1rem;
    overflow: hidden;
    height: 20px;
    line-height: 20px;
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.ticker-track {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.ticker-track.scrolling {
    animation: tickerScroll var(--ticker-duration, 40s) linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (max-width: 1023px) {
    .ticker-wrap { display: none; }
}

/* ── 메인 콘텐츠 ── */
.main { flex: 1; margin-left: var(--sidebar-w); transition: margin-left 0.25s; min-width: 0; overflow-x: hidden; }
.content { padding: 1.5rem; padding-top: calc(var(--topbar-h) + 1.5rem); max-width: 100%; }

/* ── 카드 ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s cubic-bezier(.4,0,.2,1), transform 0.2s;
    overflow: hidden;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.03); }
html.dark .card { background: #1e293b; border-color: #334155; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text-primary);
}
.card-body { padding: 1.25rem; }

/* ── KPI 카드 ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-500);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.2s cubic-bezier(.4,0,.2,1), box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
}
.kpi-card:active { transform: translateY(-1px); }
.kpi-card.success { border-left-color: var(--success-600); }
.kpi-card.error   { border-left-color: var(--error-600); }
.kpi-card.warning { border-left-color: var(--warning-600); }
.kpi-card.info    { border-left-color: #0ea5e9; }
.kpi-card.offline { border-left-color: var(--offline-600); }
html.dark .kpi-card { background: #1e293b; border-color: #334155; }

.kpi-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    position: relative; z-index: 2;
}
.kpi-value {
    font-size: 2rem; font-weight: 700;
    line-height: 1.2;
    position: relative; z-index: 2;
    color: var(--text-primary);
}
.kpi-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    position: relative; z-index: 2;
}
.kpi-bg-icon {
    position: absolute; right: -4px; bottom: -6px;
    font-size: 3.25rem; opacity: 0.12;
    transform: rotate(-12deg);
    pointer-events: none; line-height: 1;
    filter: saturate(0.7);
}

/* ── 버튼 ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    font-size: 0.875rem; font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s;
    cursor: pointer; border: none;
    font-family: inherit;
    white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff;
    box-shadow: 0 1px 3px rgba(32,165,67,0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 3px 10px rgba(32,165,67,0.3);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--offline-50); }
html.dark .btn-secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-300);
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ── 배지 ── */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.1875rem 0.75rem;
    font-size: 0.8125rem; font-weight: 500;
    border-radius: 9999px;
    border: 1px solid transparent;
}
.badge-online  { background: var(--success-50);  color: var(--success-700);  border-color: #bbf7d0; }
.badge-offline { background: var(--offline-100); color: var(--offline-600); border-color: #d1d5db; }
.badge-alarm   { background: var(--error-50);    color: var(--error-700);   border-color: #fecaca; }
.badge-warning { background: var(--warning-50);  color: var(--warning-700); border-color: #fde68a; }
.badge-green   { background: var(--success-50);  color: var(--success-700);  border-color: #bbf7d0; }
.badge-red     { background: var(--error-50);    color: var(--error-700);   border-color: #fecaca; }
.badge-amber   { background: var(--warning-50);  color: var(--warning-700); border-color: #fde68a; }
.badge-blue    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
html.dark .badge-green { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
html.dark .badge-red   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
html.dark .badge-amber { background: #78350f; color: #fcd34d; border-color: #92400e; }
html.dark .badge-blue  { background: #1e3a5f; color: #93c5fd; border-color: #1e40af; }

/* ── 상태 점 ── */
.status-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
}
.status-dot.online  { background: var(--success-600); box-shadow: 0 0 0 3px var(--success-100); }
.status-dot.offline { background: var(--offline-600); box-shadow: 0 0 0 3px var(--offline-100); }
.status-dot.alarm   { background: var(--error-600);   box-shadow: 0 0 0 3px var(--error-100); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px var(--error-100); }
    50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0.1); }
}

/* ── 테이블 ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 0.7rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.table th {
    font-weight: 600; color: var(--text-secondary);
    font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: rgba(0,0,0,0.02); }
html.dark .table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ── 폼 입력 ── */
.form-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(32,165,67,.1);
    background: #fff;
}
.form-input::placeholder { color: var(--text-muted); }
html.dark .form-input { background: #1e293b; border-color: #334155; color: #f1f5f9; }
html.dark .form-input:focus { background: #334155; }

/* ── 그리드 ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ── 강의실 카드 ── */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.room-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    background: var(--card-bg);
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    position: relative;
}
.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-300);
}
.room-card.occupied { border: 2px solid var(--success-600); background: rgba(5,150,105,0.04); }
.room-card.empty    { border: 2px solid var(--border-color); }

/* ── 스켈레톤 ── */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--border-light) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    display: inline-block;
    min-width: 40px;
    min-height: 1em;
}
@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ── DEMO 뱃지 ── */
.demo-badge {
    background: linear-gradient(135deg, var(--warning-600), var(--error-600));
    color: #fff; padding: 3px 10px;
    border-radius: 20px; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.03em;
}

/* ── 다크모드 토글 ── */
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
}
.theme-toggle:hover { background: var(--primary-50); border-color: var(--primary-300); }

/* ── 토스트 ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: 10px;
    color: #fff; font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: toastSlideIn 0.3s ease;
    position: relative; overflow: hidden;
}
.toast::after {
    content: ''; position: absolute; bottom: 0; left: 0; height: 3px;
    background: rgba(255,255,255,0.4);
    animation: toastProgress 3s linear forwards;
}
.toast.success { background: var(--success-600); }
.toast.error   { background: var(--error-600); }
.toast.info    { background: #3b82f6; }
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ── 유틸리티 ── */
.hidden { display: none !important; }

/* ── 모달 ── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(17,24,39,0.5);
    backdrop-filter: blur(6px);
    z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: modalBgIn 0.2s ease;
}
.modal-card {
    background: var(--card-bg);
    border-radius: 1.125rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.18);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    animation: modalCardIn 0.25s cubic-bezier(.21,1.02,.73,1);
}
@keyframes modalBgIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalCardIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── AI 자율운전 성과바 ── */
.ai-status-footer {
    position: fixed; bottom: 0;
    left: var(--sidebar-w); right: 0;
    z-index: 30;
    background: linear-gradient(135deg, #127e3c, #20a543);
    height: var(--footer-h);
    box-shadow: 0 -4px 24px rgba(18,126,60,0.3);
    transition: left 0.25s;
}
html.dark .ai-status-footer {
    background: linear-gradient(135deg, #0a3d1e, #0e5429);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.ai-footer-inner {
    height: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}
.ai-footer-item {
    display: flex; align-items: center; gap: 6px;
    padding: 0 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.8125rem;
    white-space: nowrap;
}
.ai-footer-item svg { opacity: 0.7; flex-shrink: 0; }
.ai-footer-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
    letter-spacing: 0.02em;
}
.ai-footer-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.ai-footer-divider {
    width: 1px; height: 24px;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

/* 운전 모드 */
.ai-footer-mode {
    gap: 8px;
}
.ai-mode-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,0.3);
    animation: aiPulse 2s infinite;
    flex-shrink: 0;
}
@keyframes aiPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52,211,153,0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(52,211,153,0.1); }
}
.ai-mode-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
}
.ai-mode-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(52,211,153,0.2);
    color: #6ee7b7;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(52,211,153,0.3);
}

/* 긴급 정지 */
.ai-footer-emergency {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 14px;
    background: #dc2626;
    color: #fff;
    border: 1px solid #ef4444;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(220,38,38,0.4);
}
.ai-footer-emergency:hover {
    background: #b91c1c;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,38,38,0.5);
}
.ai-footer-emergency:active { transform: translateY(0); }

/* 반응형 - 풋터 */
@media (max-width: 1023px) {
    .ai-status-footer { left: 0; }
    .ai-footer-label { display: none; }
    .ai-footer-item { padding: 0 0.5rem; }
}
@media (max-width: 640px) {
    .ai-footer-inner { gap: 0; font-size: 0.75rem; }
    .ai-mode-label { display: none; }
    .ai-footer-item:nth-child(n+8) { display: none; }
}

/* ── 애니메이션 ── */
@keyframes fadeIn    { from { opacity: 0; transform: translateY(8px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn   { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes spin      { to { transform: rotate(360deg); } }

/* ── 반응형 ── */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 0 1rem; left: 0; }
    .quick-control-footer { left: 0; }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .room-grid { grid-template-columns: 1fr 1fr; }
    .content { padding: 0.75rem; padding-top: calc(var(--topbar-h) + 0.75rem); padding-bottom: 80px; }
    .topbar-title { font-size: 0.8rem; }
    .card { padding: 1rem; }
    .ai-status-footer { font-size: 0.7rem; }
    .ai-footer-inner { gap: 8px; }
    .ai-footer-divider { display: none; }
    .ai-footer-label { display: none; }
    .hide-mobile { display: none !important; }
    .show-mobile { display: flex !important; }
    .mobile-logo { display: flex !important; }
    .sidebar-close-btn { display: block !important; }
    .ticker-wrap { display: none; }
    .demo-badge { display: none; }
    .topbar-right { gap: 6px; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .room-grid { grid-template-columns: 1fr; }
    .sidebar-logo .logo-text h1 { font-size: 0.85rem; }
}
