:root {
    --primary: #b71c1c;
    --primary-hover: #9a1717;
    --primary-active: #7b1212;
    --primary-rgb: 183, 28, 28;
    --primary-light: rgba(183, 28, 28, 0.1);
    --primary-lighter: rgba(183, 28, 28, 0.2);
    --blue: #0d6efd;
    --green: #198754;
    --yellow: #ffc107;
    --gray: #6c757d;
    --white: #ffffff;
    --g50: #f8f9fa;
    --g100: #e9ecef;
    --g200: #ced4da;
    --g300: #dee2e6;
    --g400: #adb5bd;
    --g500: #6c757d;
    --g600: #495057;
    --g700: #343a40;
    --g800: #212529;
    --success-bg: #d1e7dd; --success-border: #badbcc; --success-text: #0f5132;
    --warning-bg: #fff3cd; --warning-border: #ffecb5; --warning-text: #664d03;
    --error-bg: #f8d7da; --error-border: #f5c2c7; --error-text: #842029;
    --info-bg: #cff4fc; --info-border: #b6effb; --info-text: #055160;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --r-sm: 0.25rem; --r-md: 0.375rem; --r-lg: 0.5rem; --r-full: 50%;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0,0,0,0.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.175);
    --transition: 0.2s ease-in-out;
}

* { box-sizing: border-box; }
body {
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--g800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(183,28,28,0.15); color: var(--g800); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== 1. Button ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font); font-size: 0.875rem; font-weight: 500;
    padding: 0.5rem 1rem; border-radius: var(--r-md); cursor: pointer;
    transition: all var(--transition); line-height: 1.5; white-space: nowrap;
    text-decoration: none; border: none;
}
.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 2px 4px rgba(183,28,28,0.2); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 8px rgba(183,28,28,0.25); }
.btn-primary:active { background: var(--primary-active); transform: scale(0.98); }
.btn-secondary { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--g50); border-color: var(--primary-hover); }
.btn-secondary:active { background: var(--g100); border-color: var(--primary-active); transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--primary); border: none; }
.btn-ghost:hover { background: var(--primary-light); }
.btn-ghost:active { background: var(--primary-lighter); transform: scale(0.98); }
.btn-sm { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
.btn-lg { font-size: 1rem; padding: 0.75rem 1.5rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* ===== 2. Button Group ===== */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { border-left: 1px solid var(--g100); }
.btn-group .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.btn-group .btn:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* ===== 3. Badge ===== */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.5rem;
    border-radius: var(--r-sm); line-height: 1.5; white-space: nowrap;
}
.badge-red { background: var(--primary); color: var(--white); }
.badge-blue { background: var(--blue); color: var(--white); }
.badge-green { background: var(--green); color: var(--white); }
.badge-yellow { background: var(--yellow); color: var(--g800); }
.badge-gray { background: var(--gray); color: var(--white); }
.badge-outline-red { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.badge-outline-blue { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.badge-outline-green { background: transparent; color: var(--green); border: 1px solid var(--green); }
.badge:hover { filter: brightness(0.9); }
.badge:active { transform: scale(0.95); }

/* ===== 4. Avatar ===== */
.avatar {
    border-radius: var(--r-full); overflow: hidden; border: 2px solid var(--white);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--g100); color: var(--g500); font-weight: 500;
    transition: all var(--transition); cursor: pointer;
}
.avatar:hover { transform: scale(1.05); box-shadow: 0 0 0 0.25rem rgba(183,28,28,0.25); border-color: var(--primary); }
.avatar:active { transform: scale(1.1); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; font-size: 0.75rem; }
.avatar-md { width: 36px; height: 36px; font-size: 1rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.5rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.5rem; }

/* ===== 5. Dropdown ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; z-index: 50;
    min-width: 10rem; background: var(--white); border: 1px solid var(--g100);
    border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 0.5rem 0;
    display: none;
}
.dropdown.show .dropdown-menu { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; font-size: 0.875rem; color: var(--g800);
    cursor: pointer; transition: background var(--transition); border: none; background: none;
    width: 100%; text-align: left; font-family: var(--font);
}
.dropdown-item:hover { background: var(--g50); }
.dropdown-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.dropdown-divider { height: 1px; background: var(--g100); margin: 0.25rem 0; }

/* ===== 6. Pagination ===== */
.pagination { display: flex; gap: 0.25rem; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--g800);
    background: var(--white); border: 1px solid var(--g100); border-radius: var(--r-sm);
    cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.page-link:hover { background: var(--g50); border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); font-weight: 500; }
.page-link:disabled { background: var(--g100); opacity: 0.6; cursor: not-allowed; }

/* ===== 7. Card ===== */
.card {
    background: var(--white); border: 1px solid var(--g100);
    border-radius: var(--r-lg); padding: 1.5rem;
    transition: all var(--transition); box-shadow: var(--shadow-sm);
}
/* .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--primary-lighter); } */
.card:active { transform: scale(0.99); }
.card-title { font-size: 1.25rem; font-weight: 600; color: var(--g800); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card-title .card-icon { color: var(--primary); font-size: 1.25rem; }
.card-text { font-size: 0.875rem; color: var(--g500); line-height: 1.6; }

/* ===== 8. Table ===== */
.table-wrapper { overflow-x: auto; border: 1px solid var(--g100); border-radius: var(--r-md); background: rgba(255,255,255,0.85);}
.chronos-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.chronos-table thead th { background: var(--g50); color: var(--g800); font-weight: 600; padding: 0.75rem; border-bottom: 1px solid var(--g100); text-align: left; }
.chronos-table tbody td { padding: 0.75rem; border-bottom: 1px solid var(--g100); color: var(--g800); }
.chronos-table tbody tr:hover { background: var(--g50); }
.chronos-table tbody tr:active { background: var(--primary-light); }
.chronos-table tbody tr:last-child td { border-bottom: none; }
.chronos-table tbody tr:nth-child(even) { background: var(--g50); }

/* ===== 9. Form ===== */
.form-control, .form-select, .form-textarea {
    width: 100%; padding: 0.375rem 0.75rem; font-size: 0.875rem;
    font-family: var(--font); color: var(--g800); background: var(--white);
    border: 1px solid var(--g200); border-radius: var(--r-md);
    transition: all var(--transition); line-height: 1.5;
}
.form-control:hover, .form-select:hover, .form-textarea:hover { border-color: #86b7fe; }
.form-control:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 0.25rem rgba(183,28,28,0.25); outline: none;
}
.form-control::placeholder { color: var(--g500); }
.form-control:disabled, .form-select:disabled { background: var(--g100); opacity: 0.6; }
.form-control.is-invalid { border-color: #dc3545; box-shadow: 0 0 0 0.25rem rgba(220,53,69,0.25); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--g600); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] {
    width: 1rem; height: 1rem; border: 1px solid var(--g200); border-radius: var(--r-sm);
    appearance: none; -webkit-appearance: none; cursor: pointer;
    transition: all var(--transition); flex-shrink: 0;
}
.form-check input[type="radio"] { border-radius: var(--r-full); }
.form-check input:checked {
    background: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8l3 3 5-5'/%3e%3c/svg%3e");
}
.form-check input:hover { border-color: var(--primary); }
.form-check input:active { transform: scale(0.95); }
.form-check-label { font-size: 0.875rem; color: var(--g800); }
.form-switch { position: relative; width: 2.5rem; height: 1.25rem; cursor: pointer; }
.form-switch input { opacity: 0; width: 0; height: 0; }
.form-switch .slider { position: absolute; inset: 0; background: var(--g200); border-radius: 1.25rem; transition: var(--transition); }
.form-switch .slider::before { content: ''; position: absolute; width: 1rem; height: 1rem; background: var(--white); border-radius: var(--r-full); top: 50%; left: 0.125rem; transform: translateY(-50%); transition: var(--transition); }
.form-switch input:checked + .slider { background: var(--primary); }
.form-switch input:checked + .slider::before { transform: translateY(-50%) translateX(1.25rem); }
.form-switch input:hover + .slider { background: var(--primary-hover); }

/* ===== 10. Alert ===== */
.alert { display: flex; align-items: flex-start; gap: 0.5rem; padding: 1rem 1.25rem; border-radius: var(--r-md); font-size: 0.875rem; border: 1px solid; transition: all 0.3s ease-in-out; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }
.alert-title { font-weight: 500; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; padding: 0.5rem; color: inherit; opacity: 0.7; font-size: 1rem; }
.alert-close:hover { opacity: 1; }

/* ===== 11. Empty State ===== */
.empty-state { background: var(--white); border-radius: var(--r-md); padding: 3rem 1.5rem; text-align: center; box-shadow: var(--shadow-sm); }
.empty-state .empty-icon { font-size: 3rem; color: var(--g500); margin-bottom: 1rem; }
.empty-state .empty-title { font-size: 1rem; font-weight: 500; color: var(--g800); margin-bottom: 0.25rem; }
.empty-state .empty-text { font-size: 0.875rem; color: var(--g500); }

/* ===== 12. Progress ===== */
.progress { height: 0.5rem; background: var(--g100); border-radius: var(--r-sm); overflow: hidden; }
.progress-lg { height: 0.75rem; }
.progress-bar { height: 100%; background: var(--primary); border-radius: var(--r-sm); transition: width 0.5s ease-in-out; }
.progress-bar:hover { box-shadow: 0 0 0.5rem rgba(183,28,28,0.5); }
.progress-text { font-size: 0.75rem; font-weight: 500; color: var(--white); }
.progress-bar-blue { background: var(--blue); }
.progress-bar-green { background: var(--green); }
.progress-bar-yellow { background: var(--yellow); }

/* ===== 13. Timeline ===== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: var(--g100); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute; left: -32px; top: 0;
    width: 16px; height: 16px; border-radius: var(--r-full);
    background: var(--g100); border: 2px solid var(--white);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.timeline-item.completed .timeline-dot { background: var(--primary); }
.timeline-item.completed .timeline-dot::after { content: '\2713'; color: var(--white); font-size: 0.6rem; font-weight: 700; }
.timeline-item:hover .timeline-dot { transform: scale(1.2); }
.timeline-item:hover .timeline-content { background: var(--g50); }
.timeline-content { padding: 1rem; border-radius: var(--r-md); cursor: pointer; transition: background var(--transition); }
.timeline-time { font-size: 0.75rem; color: var(--g500); margin-bottom: 0.25rem; }
.timeline-title { font-size: 0.875rem; font-weight: 500; color: var(--g800); margin-bottom: 0.25rem; }
.timeline-text { font-size: 0.875rem; color: var(--g500); line-height: 1.6; }

/* ===== 14. Rating ===== */
.rating { display: inline-flex; gap: 0.25rem; }
.rating-star { cursor: pointer; font-size: 1.25rem; color: var(--g100); transition: all 0.2s ease-in-out; }
.rating-star:hover, .rating-star.hover { color: var(--yellow); }
.rating-star.active { color: var(--primary); }
.rating-star:active { transform: scale(0.95); }
.rating-text { font-size: 0.875rem; color: var(--g800); margin-left: 0.5rem; }

/* ===== App Layout ===== */
#sidebar {
    width: 18rem; background: var(--white); border-right: 1px solid var(--g100);
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: all 0.3s ease; z-index: 20;
}
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--g100); display: flex; align-items: center; gap: 0.75rem; }
.sidebar-logo {
    width: 2.5rem; height: 2.5rem; border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(183,28,28,0.25);
}
.sidebar-logo svg { width: 1.25rem; height: 1.25rem; color: var(--white); }
.sidebar-brand { font-weight: 700; font-size: 1.25rem; color: var(--g800); }
.sidebar-subtitle { font-size: 0.625rem; color: var(--g500); letter-spacing: 0.2em; text-transform: uppercase; }
.sidebar-section { padding: 1rem; }
.sidebar-section-title { font-size: 0.75rem; color: var(--g500); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-bottom: 0.75rem; }
.sidebar-nav { padding: 0.5rem 0.75rem; border-top: 1px solid var(--g100); }
.sidebar-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1rem; border-radius: var(--r-md);
    font-size: 0.875rem; color: var(--g500); cursor: pointer;
    transition: all var(--transition); text-decoration: none; width: 100%;
    border: none; background: none; font-family: var(--font);
}
.sidebar-nav-item:hover { background: var(--g50); color: var(--g800); }
.sidebar-nav-item.active { background: var(--primary); color: var(--white); font-weight: 500; }
.sidebar-nav-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.entity-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.75rem; border-radius: var(--r-md);
    cursor: pointer; transition: all var(--transition); position: relative;
}
.entity-item:hover { background: var(--g50); }
.entity-item.active { background: var(--primary-light); }
.entity-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--primary); border-radius: 0 2px 2px 0;
}
.entity-dot { width: 8px; height: 8px; border-radius: var(--r-full); border: 1.5px solid var(--g300); flex-shrink: 0; transition: all var(--transition); }
.entity-item.active .entity-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(183,28,28,0.15); }
.entity-delete-btn { opacity: 0; transition: all var(--transition); }
.entity-item:hover .entity-delete-btn { opacity: 1; }

.app-header { height: 3.5rem; background: var(--white); border-bottom: 1px solid var(--g100); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; flex-shrink: 0; }

/* ===== Chat ===== */
.msg-user {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--white); border-radius: 1.125rem 1.125rem 0.25rem 1.125rem;
    box-shadow: 0 2px 8px rgba(183,28,28,0.15);
}
.msg-assistant {
    background: var(--white); border: 1px solid var(--g100);
    border-radius: 1.125rem 1.125rem 1.125rem 0.25rem;
    box-shadow: var(--shadow-sm);
}
.msg-assistant p { margin-bottom: 0.5em; }
.msg-assistant p:last-child { margin-bottom: 0; }
.msg-time { font-size: 0.625rem; color: var(--g500); letter-spacing: 0.05em; }
.streaming-cursor::after { content: ''; display: inline-block; width: 2px; height: 1em; background: var(--primary); margin-left: 2px; animation: blink 0.8s ease-in-out infinite; vertical-align: text-bottom; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.typing-indicator span { display: inline-block; width: 6px; height: 6px; border-radius: var(--r-full); background: var(--g400); margin: 0 2px; animation: typing 1.2s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100%{transform:translateY(0);opacity:0.4} 30%{transform:translateY(-6px);opacity:1} }

/* ===== Glass Overrides (clean white, no frosted glass) ===== */
.glass-panel { background: var(--white); border: 1px solid var(--g100); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.glass-panel-strong { background: var(--white); border: 1px solid var(--g100); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.glass-header { background: var(--white); border-bottom: 1px solid var(--g100); }
.glass-input {
    background: var(--white); border: 1px solid var(--g200); border-radius: var(--r-md);
    padding: 0.375rem 0.75rem; font-size: 0.875rem; color: var(--g800);
    transition: all var(--transition); font-family: var(--font);
}
.glass-input:focus { border-color: var(--primary); box-shadow: 0 0 0 0.25rem rgba(183,28,28,0.25); outline: none; }
.glass-input::placeholder { color: var(--g500); }

/* ===== Tabs ===== */
.tab-bar { display: flex; gap: 0.25rem; padding: 0.25rem; background: var(--g100); border-radius: var(--r-md); }
.tab-item { padding: 0.5rem 1rem; font-size: 0.875rem; color: var(--g500); border-radius: var(--r-sm); cursor: pointer; transition: all var(--transition); border: none; background: none; font-family: var(--font); font-weight: 500; }
.tab-item:hover { background: var(--white); color: var(--g800); }
.tab-item.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ===== Login ===== */
.login-card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-md); border: 1px solid var(--g100); }

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--white); border-radius: var(--r-lg); padding: 2rem; width: 100%; max-width: 28rem; box-shadow: var(--shadow-lg); border: 1px solid var(--g100); }
.modal-title { font-size: 1.125rem; font-weight: 600; color: var(--g800); margin-bottom: 1.25rem; }

/* ===== Loading ===== */
.loading-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; }
.loading-spinner { width: 2.5rem; height: 2.5rem; border: 3px solid var(--g300); border-top-color: var(--primary); border-radius: var(--r-full); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.875rem; color: var(--g500); margin-top: 0.75rem; }

/* ===== Notification ===== */
.notification {
    position: fixed; top: 1rem; right: 1rem; z-index: 50;
    padding: 0.75rem 1rem; border-radius: var(--r-md); font-size: 0.875rem;
    font-weight: 500; box-shadow: var(--shadow-md); animation: fadeInUp 0.3s ease-out;
    display: flex; align-items: center; gap: 0.5rem;
}
.notification-info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.notification-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.notification-error { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }

/* ===== Data Tab ===== */
.data-tab { color: var(--g500); transition: all var(--transition); }
.data-tab:hover { background: var(--white); color: var(--g700); }
.data-tab.\!bg-primary { background: var(--primary) !important; color: #fff !important; font-weight: 500 !important; }

/* ===== Animations ===== */
@keyframes fadeInUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.animate-fade-in { animation: fadeInUp 0.3s ease-out; }

/* ===== Line clamp ===== */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #sidebar { position: fixed; left: -18rem; top: 0; bottom: 0; z-index: 30; }
    #sidebar.open { left: 0; }
}

/* ===== Sidebar Nav Divider ===== */
.nav-divider { height: 1px; background: var(--g100); margin: 0.25rem 0.5rem; }

/* ===== YJ Sidebar Tweaks ===== */
#app-shell #sidebar { width: 14rem; min-height: 100vh; position: sticky; top: 0; }
#app-shell .sidebar-nav-item { font-size: 0.8125rem; gap: 0.625rem; padding: 0.5rem 0.75rem; }
#app-shell .sidebar-nav-item svg { width: 0.875rem; height: 0.875rem; }
#app-shell .sidebar-header { padding: 1rem 0.75rem; }
#app-shell .sidebar-brand { font-size: 1rem; }
#app-shell .sidebar-nav { padding: 0.375rem 0.5rem; border-top: none; }

/* ===== YJ 2-Level Nav Group ===== */
.nav-group { margin-bottom: 0.125rem; }
.nav-group-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: var(--r-md);
    font-size: 1rem; color: var(--g500); cursor: pointer;
    user-select: none; transition: all var(--transition);
    font-weight: 500; letter-spacing: 0.03em;
}
.nav-group-header:hover { background: var(--g50); color: var(--g700); }
.nav-group-ico { width: 1rem; height: 1rem; flex-shrink: 0; opacity: 0.6; }
.nav-group-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-chevron { width: 0.875rem; height: 0.875rem; flex-shrink: 0; transition: transform 0.2s ease; opacity: 0.5; }
.nav-group.open .nav-group-chevron { transform: rotate(90deg); }
.nav-group-body { display: none; padding-left: 0.375rem; }
.nav-group.open .nav-group-body { display: block; }
.nav-group-body .sidebar-nav-item { font-size: 0.8125rem; padding: 0.4rem 0.75rem 0.4rem 2rem; }

/* ===== YJ Sidebar Footer ===== */
.sidebar-footer {
    flex-shrink: 0; display: flex; align-items: center; gap: 0.625rem;
    padding: 0.75rem 0.875rem; border-top: 1px solid var(--g100);
    background: var(--g50);
}
.sidebar-footer-logo {
    width: 32px; height: 32px; border-radius: var(--r-sm); overflow: hidden;
    background: var(--white); border: 1px solid var(--g200);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-footer-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-footer-logo svg { width: 16px; height: 16px; color: var(--g400); }
.sidebar-footer-info { min-width: 0; }
.sidebar-footer-name { font-size: 0.75rem; font-weight: 600; color: var(--g700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-sub { font-size: 0.625rem; color: var(--g400); margin-top: 0.125rem; }

/* ===== YJ Sidebar Footer Logout ===== */
.sidebar-logout-btn {
    margin-left: auto;
    flex-shrink: 0;
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0.35rem 0.5rem; border-radius: var(--r-sm);
    font-size: 0.7rem; color: #dc3545; cursor: pointer;
    text-decoration: none; white-space: nowrap;
    transition: background .15s;
}
.sidebar-logout-btn:hover { background: rgba(220,53,69,0.08); }
.sidebar-logout-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--g300) transparent; }
*::-webkit-scrollbar { width: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--g300); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: var(--g400); }
