* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #1a2b4a;
    --blue: #2563EB;
    --light-gray: #f8fafc;
    --white: #ffffff;
    --status-blue: #2563EB;
    --status-red: #EF4444;
    --status-orange: #F97316;
    --status-gray: #6B7280;
    --status-green: #22C55E;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--light-gray);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.number,
.metric {
    font-family: 'Montserrat', sans-serif;
}

/* ===== LOGIN PAGE ===== */
#login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a2b4a 0%, #2563EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#login-page.hidden {
    display: none;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -1px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
}

.login-form .form-group {
    margin-bottom: 18px;
}

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

.login-form .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.login-form .form-input:focus {
    border-color: var(--blue);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
    font-family: 'Noto Sans KR', sans-serif;
}

.login-btn:hover {
    background: #1d4ed8;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-red);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
    text-align: center;
}

.login-error.visible {
    display: block;
}

.test-accounts {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.test-accounts-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-account-btn {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: var(--light-gray);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 6px;
    text-align: left;
    transition: background 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-primary);
}

.test-account-btn:hover {
    background: #e2e8f0;
}

.test-account-btn strong {
    color: var(--blue);
}

.lang-notice {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 16px;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    height: 100vh;
}


/* Header는 높이 고정 */
header {
    flex-shrink: 0;
}

/* children 영역만 스크롤 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    flex-shrink: 0;
    height: 100vh;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--blue);
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.menu-section-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    padding: 8px 20px 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar.collapsed .menu-section-label {
    display: none;
}

.menu-item {
    padding: 11px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-item.active {
    background: var(--blue);
    color: white;
    border-left: 4px solid white;
}

.menu-item i {
    width: 20px;
    font-size: 17px;
    flex-shrink: 0;
}

.sidebar.collapsed .menu-text {
    display: none;
}

.menu-text {
    line-height: 1.3;
}

.menu-text .vn {
    font-size: 11px;
    display: block;
    opacity: 0.75;
}

.menu-text .kr {
    font-size: 13px;
    font-weight: 600;
    display: block;
}

.project-tree {
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tree-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .tree-label {
    display: none;
}

.sidebar.collapsed .project-tree {
    padding: 10px 8px;
}

.tree-item {
    padding: 7px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 3px;
    transition: all 0.2s;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tree-item.active {
    background: var(--blue);
    color: white;
}

.sidebar.collapsed .tree-item span {
    display: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-nav {
    height: 62px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light-gray);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 180px;
    font-size: 14px;
}

.notification-icon {
    position: relative;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--status-red);
    color: white;
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.logout-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.logout-btn:hover {
    background: var(--status-red);
    color: white;
    border-color: var(--status-red);
}

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-title .vn {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-card {
    background: white;
    padding: 22px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-label .vn {
    font-size: 10px;
    display: block;
}

.kpi-label .kr {
    font-size: 13px;
    font-weight: 600;
    display: block;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.kpi-icon.total {
    background: rgba(37, 99, 235, 0.1);
    color: var(--status-blue);
}

.kpi-icon.progress {
    background: rgba(37, 99, 235, 0.1);
    color: var(--status-blue);
}

.kpi-icon.delayed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-red);
}

.kpi-icon.comment {
    background: rgba(249, 115, 22, 0.1);
    color: var(--status-orange);
}

.kpi-value {
    font-size: 34px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

.kpi-change {
    font-size: 12px;
    color: var(--status-green);
}

.kpi-change.negative {
    color: var(--status-red);
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
}

.card-title .vn {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 13px;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: var(--status-green);
    color: white;
}

.btn-danger {
    background: var(--status-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-gray);
}

th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th .vn {
    font-size: 10px;
    display: block;
    font-weight: 400;
}

th .kr {
    display: block;
}

th:hover {
    background: #e2e8f0;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

tr:hover {
    background: var(--light-gray);
}

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.progress {
    background: rgba(37, 99, 235, 0.1);
    color: var(--status-blue);
}

.status-badge.delayed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-red);
}

.status-badge.comment {
    background: rgba(249, 115, 22, 0.1);
    color: var(--status-orange);
}

.status-badge.completed {
    background: rgba(107, 114, 128, 0.1);
    color: var(--status-gray);
}

.status-badge.admin {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-red);
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--status-green);
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 7px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--light-gray);
}

.filter-tab.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    border: 3px solid white;
}

.timeline-content {
    background: var(--light-gray);
    padding: 11px;
    border-radius: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.timeline-title {
    font-weight: 600;
    font-size: 13px;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--blue);
    background: rgba(37, 99, 235, 0.03);
}

.upload-icon {
    font-size: 44px;
    color: var(--blue);
    margin-bottom: 14px;
}

.upload-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content.modal-lg {
    max-width: 700px;
}

.modal-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-title .vn {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.form-label .vn {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 400;
    display: inline;
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-input:focus {
    border-color: var(--blue);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    background: white;
}

.form-select:focus {
    border-color: var(--blue);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--status-green);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: left 0.2s;
}

.toggle-switch.active::after {
    left: 22px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: white;
    padding: 14px 22px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    min-width: 260px;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 22px;
}

.toast-icon.success {
    color: var(--status-green);
}

.toast-icon.error {
    color: var(--status-red);
}

.toast-message {
    font-weight: 600;
    font-size: 13px;
}

/* ===== CHART ===== */
.chart-container {
    position: relative;
    height: 280px;
}

/* ===== GRID ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 18px;
}

.page-btn {
    padding: 7px 11px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.page-btn:hover {
    background: var(--light-gray);
}

.page-btn.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

/* ===== SCREEN ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ===== CHAT ===== */
.chat-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 118px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sidebar-title {
    font-weight: 700;
    font-size: 15px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-item:hover {
    background: var(--light-gray);
}

.chat-item.active {
    background: rgba(37, 99, 235, 0.07);
    border-left: 3px solid var(--blue);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-avatar.green {
    background: var(--status-green);
}

.chat-avatar.orange {
    background: var(--status-orange);
}

.chat-avatar.red {
    background: var(--status-red);
}

.chat-avatar.group {
    background: var(--navy);
    font-size: 12px;
}

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

.chat-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.chat-preview {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-time {
    font-size: 10px;
    color: var(--text-secondary);
}

.chat-badge {
    background: var(--status-red);
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f4f8;
}

.chat-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-weight: 700;
    font-size: 15px;
}

.chat-header-status {
    font-size: 11px;
    color: var(--status-green);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.msg-row.mine {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--status-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 60%;
}

.msg-row.mine .msg-bubble-wrap {
    align-items: flex-end;
}

.msg-sender {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.msg-bubble.other {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.msg-bubble.mine {
    background: var(--blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.chat-input-area {
    padding: 14px 16px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    font-size: 13px;
    outline: none;
    font-family: 'Noto Sans KR', sans-serif;
    transition: border 0.2s;
    resize: none;
}

.chat-input:focus {
    border-color: var(--blue);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #1d4ed8;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    color: var(--text-secondary);
    gap: 12px;
}

.chat-placeholder i {
    font-size: 48px;
    opacity: 0.3;
}

.chat-placeholder p {
    font-size: 14px;
}

/* ===== USER MANAGE ===== */
.user-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.user-info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-big-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.user-detail {
    flex: 1;
}

.user-detail-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 3px;
}

.user-detail-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-detail-meta {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    background: var(--light-gray);
    border-radius: 6px;
    padding: 2px 7px;
}

.lang-badge {
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}

/* ===== COUNTRY FLAGS ===== */
.flag {
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar .menu-text,
    .sidebar .logo-text,
    .sidebar .tree-label,
    .sidebar .project-tree span,
    .sidebar .menu-section-label {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-area {
        padding: 16px;
    }

    .chat-sidebar {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}