/* 심사노트(SimsaNote) - Professional Dashboard Styles */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Background */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Border */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 14px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Header height for calc */
    --header-h: 56px;
    --stats-h: 80px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    height: var(--header-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    flex-shrink: 0;
    min-width: 260px;
}

.header-left .logo {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.header-nav,
.header-nav .nav-link {
    white-space: nowrap;
}

.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 var(--spacing-lg);
}

.search-bar {
    display: flex;
    gap: 0;
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    color: var(--text-primary);
    font-size: 0.82rem;
    transition: border-color 0.2s, background 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.search-bar button {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: var(--border-radius);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.search-bar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== Buttons ===== */
.btn-primary {
    padding: 7px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 7px 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:active {
    transform: translateY(0);
}

.full-width {
    width: 100%;
    margin-top: 4px;
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    gap: 12px;
    padding: 12px var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    height: var(--stats-h);
    align-items: stretch;
}

.stat-card {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border: 1px solid var(--border-light);
    transition: border-color 0.15s;
}

.stat-card:hover {
    border-color: var(--border-color);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-value.urgent {
    color: var(--danger);
}

/* Stats Bar — 심사역 대시보드 추가 스타일 */
.stat-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-trend {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.stat-trend--up {
    color: var(--success);
}

.stat-trend--down {
    color: var(--danger);
}

.stat-card--highlight {
    border-color: rgba(37, 99, 235, 0.25);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(139, 92, 246, 0.04));
}

.stat-card--highlight .stat-value {
    color: var(--primary);
}

.stat-card--clickable {
    cursor: pointer;
    position: relative;
}
.stat-card--clickable:hover {
    background: var(--bg-hover, rgba(0,0,0,0.03));
}

/* 상단 통계 카드 클릭 시 대상 딜 리스트 드롭다운 */
.stat-dropdown {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    max-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    padding: 8px 0;
}
.stat-dropdown.hidden {
    display: none !important;
}
.stat-dropdown-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 14px 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}
.stat-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.stat-dropdown-item:hover {
    background: var(--bg-hover, rgba(37,99,235,0.08));
}
.stat-dropdown-item.empty {
    color: var(--text-muted);
    cursor: default;
}

/* Tooltip — ? 아이콘 힌트 */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    margin-left: 3px;
    cursor: help;
    transition: background 0.2s;
    vertical-align: middle;
    line-height: 1;
}

.tooltip-icon:hover {
    background: var(--primary);
}

.custom-tooltip {
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 240px;
    line-height: 1.4;
    display: none;
    white-space: normal;
}

/* Top Deal Cards (차트 영역) */
.top-deal-card {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    transition: all 0.15s;
}

.top-deal-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* ===== Main Container ===== */
.main-container {
    display: flex;
    height: calc(100vh - var(--header-h) - var(--stats-h));
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: var(--spacing-md);
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: var(--spacing-md);
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-section h4 {
    font-size: 0.78rem;
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* View Toggle — horizontal compact */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    border: 1px solid var(--border-light);
}

.view-btn {
    flex: 1;
    padding: 6px 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    font-size: 0.75rem;
    font-weight: 500;
}

.view-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

/* Filter Groups */
.filter-group {
    margin-bottom: 12px;
}

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 4px 0;
}

.filter-select-all {
    font-size: 0.7rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.filter-select-all:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.1s;
}

.filter-group label:hover {
    color: var(--text-primary);
}

.filter-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 3px;
}

.filter-group select {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: border-color 0.15s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    position: relative;
    /* For absolute positioning of empty state */
}

.view-container {
    display: none;
}

.view-container.active {
    display: block;
    height: 100%;
}

/* ===== Kanban Board ===== */
.kanban-board {
    display: flex;
    gap: 12px;
    height: 100%;
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.kanban-column {
    flex: 1;
    min-width: 260px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.column-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.column-header h3 {
    font-size: 0.82rem;
    margin: 0;
    font-weight: 600;
}

.column-count {
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    min-width: 24px;
    text-align: center;
}

.column-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Deal Card ===== */
.deal-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
    position: relative;
    /* [FIX] absolute overlay containment */
}

.deal-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.deal-card.deal-card--team {
    border-left: 3px solid #94a3b8;
}

/* 전체 보기 시: 내가 담당자인 딜 강조, 그 외 음영 */
.deal-scope-mixed .deal-card.deal-card--assigned-to-me {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, var(--bg-card) 40%);
    border: 2px solid #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}
.deal-scope-mixed .deal-card.deal-card--assigned-to-me:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.deal-scope-mixed .deal-card.deal-card--not-assigned {
    opacity: 0.78;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0%, var(--bg-card) 12%);
}
.deal-scope-mixed .deal-card.deal-card--not-assigned:hover {
    opacity: 0.92;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
    flex: 1;
}

.card-menu {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.1s;
    line-height: 1;
    flex-shrink: 0;
}

.card-menu:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.card-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.badge-category {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.badge-stage {
    background: rgba(139, 92, 246, 0.08);
    color: var(--secondary);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.card-score {
    margin-bottom: 8px;
}

.score-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.score-bar {
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s;
}

.card-highlights {
    margin-bottom: 8px;
}

.highlight-item {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: 3px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.tag {
    padding: 1px 7px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
    font-size: 0.68rem;
    color: var(--primary);
    font-weight: 500;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.priority-badge {
    font-size: 0.85rem;
}

/* ===== Grid View ===== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* ===== List View ===== */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 리스트: 기존 카드 형태 유지, 가로 배치 + 열 너비만 고정 */
.list-container .deal-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    flex-wrap: nowrap;
    min-width: 0;
}

/* 열 너비 고정으로 레이아웃 일정하게 */
.list-container .deal-card .card-header {
    min-width: 160px;
    max-width: 200px;
    flex-shrink: 0;
}
.list-container .deal-card .card-header .card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-container .deal-card .card-subtitle {
    min-width: 140px;
    max-width: 180px;
    flex-shrink: 0;
}
.list-container .deal-card .card-meta {
    min-width: 100px;
    flex-shrink: 0;
}
.list-container .deal-card .card-score {
    min-width: 90px;
    flex-shrink: 0;
}
.list-container .deal-card .card-highlights {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-container .deal-card .card-tags {
    min-width: 80px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 상단 고정(핀)·업로드 날짜 우측 정렬 */
.list-container .deal-card .card-footer {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}
.list-container .deal-card .card-footer span {
    order: 1;
}
.list-container .deal-card .card-footer .pin-btn {
    order: 2;
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    /* Overlay Styles */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(241, 245, 249, 0.4);
    /* Subtle transparent background */
    backdrop-filter: blur(2px);
    /* Optional: slight blur for better focus */
    z-index: 10;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.6;
}

.empty-state h2 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state p {
    margin-bottom: var(--spacing-lg);
    font-size: 0.85rem;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.1s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-body input {
    width: 100%;
    padding: 8px 12px;
    margin: var(--spacing-sm) 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color 0.15s;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.api-key-status {
    margin-top: var(--spacing-sm);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
}

.api-key-status.success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.api-key-status.error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ===== Analysis Modal (overlay) ===== */
.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.field-group {
    margin-bottom: 12px;
}

.field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.field-input,
.field-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.field-input:focus,
.field-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Contact cards */
.contact-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 6px;
}

.contact-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.contact-detail {
    font-size: 0.72rem;
    color: var(--primary);
}

/* Add row (contacts, action items) */
.add-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.add-input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: border-color 0.15s;
}

.add-input:focus {
    outline: none;
    border-color: var(--primary);
}

.add-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.add-btn:hover {
    background: var(--primary-dark);
}

/* Todo / Action Items */
.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 6px;
    font-size: 0.82rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.todo-item .todo-check,
.todo-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
}

.todo-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.todo-text {
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 100%;
    color: var(--text-primary);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.todo-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.1s;
}

.todo-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Saved toast */
.saved-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    z-index: 10000;
    animation: slideInToast 0.25s ease;
}

@keyframes slideInToast {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cancel button in modal */
.btn-cancel {
    padding: 7px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Drag and Drop ===== */
.deal-card.dragging {
    opacity: 0.4;
    transform: rotate(1deg) scale(0.98);
}

.column-content.drag-over {
    background: rgba(37, 99, 235, 0.04);
    border: 2px dashed var(--primary-light);
    border-radius: var(--border-radius);
}

/* ===== Loading States ===== */
.dashboard-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-tertiary, #e2e8f0);
    border-top-color: var(--primary, #2563eb);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.dashboard-loading-text {
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.card-analyzing {
    border-color: var(--primary-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

}

.pro-gated>*:not(.pro-overlay) {
    filter: blur(6px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.pro-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--primary);
    width: 80%;
    max-width: 420px;
    backdrop-filter: blur(4px);
}

body.dark-mode .pro-overlay {
    background: rgba(30, 41, 59, 0.9);
}

.pro-overlay h4 {
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.pro-overlay p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .kanban-column {
        min-width: 240px;
    }
}

/* 중간 폭: 헤더를 미리 2줄로 → 내비/버튼 깨짐 방지 */
@media (max-width: 960px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px var(--spacing-lg);
    }

    .header-left {
        min-width: 0;
    }

    .header-center {
        order: 3;
        width: 100%;
        margin: 8px 0 0 0;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px var(--spacing-md);
        gap: 8px;
    }

    .header-left {
        min-width: 0;
    }

    .header-nav {
        flex-wrap: wrap;
        gap: 4px;
    }

    .header-center {
        order: 3;
        width: 100%;
        margin: 8px 0 0 0;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .stats-bar {
        flex-wrap: wrap;
        height: auto;
        gap: 8px;
        padding: 10px var(--spacing-md);
    }

    .stat-card {
        min-width: 120px;
    }

    .main-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        min-width: 100%;
    }
}

/* 모바일: 터치·가독성 중심 */
@media (max-width: 480px) {
    .header {
        padding: 8px var(--spacing-sm);
        gap: 6px;
    }

    .header-nav .nav-link {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .header-center {
        margin: 6px 0 0 0;
    }

    .search-bar input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .search-bar button {
        padding: 10px 14px;
        min-height: 44px;
    }

    .header-right .btn-primary,
    .header-right .btn-secondary {
        padding: 10px 12px;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .header-right .theme-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .stats-bar {
        gap: 6px;
        padding: 8px var(--spacing-sm);
    }

    .stat-card {
        min-width: 100px;
        padding: 8px 10px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .sidebar {
        padding: var(--spacing-sm);
    }

    .view-btn {
        padding: 8px 6px;
        font-size: 0.7rem;
    }
}

/* ===== Dark Mode Toggle ===== */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
    line-height: 1;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

/* ===== Notification Badge ===== */
.notif-badge {
    position: relative;
}

.notif-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-badge[data-count="0"]::after {
    display: none;
}

/* ===== Dark Mode ===== */
body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --border-color: #334155;
    --border-light: #283548;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .deal-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

body.dark-mode .stat-card {
    background: var(--bg-hover);
}

body.dark-mode .column-header {
    background: rgba(51, 65, 85, 0.5);
}

body.dark-mode .score-bar {
    background: var(--bg-hover);
}

body.dark-mode .tag {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .badge-category {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .settings-tab {
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .settings-tab.active {
    color: var(--text-primary) !important;
}

body.dark-mode .view-toggle {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

body.dark-mode .view-btn.active {
    background: var(--primary);
}

body.dark-mode .search-bar input,
body.dark-mode .search-bar button {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .empty-state h2 {
    color: var(--text-secondary);
}

/* ===== App Footer ===== */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0;
    position: relative;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    /*
    *   Project: 심사노트
    *   Description: VC 심사역을 위한 올인원 투자 관리 플랫폼
    *   Version: 3.1
    */
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--info));
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    font-size: 1.5rem;
}

.footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.footer-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.footer-contact-item {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

.footer-contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-contact-item a:hover {
    color: var(--primary);
}

.footer-copy-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

body.dark-mode .app-footer {
    background: var(--bg-secondary);
}

body.dark-mode .app-footer::before {
    opacity: 0.7;
}

/* ===== Pro Feature Gating ===== */
.pro-gated-container {
    position: relative;
    overflow: hidden;
}

.pro-gated-blur {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.pro-overlay-simple {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.pro-overlay-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e2e8f0);
    max-width: 320px;
}

.pro-overlay-card h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--text-primary, #1e293b);
}

.pro-overlay-card p {
    margin: 0 0 20px;
    font-size: 0.85rem;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
}