﻿:root {
    /* Notion-like Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f5;
    /* Sidebar & Hover */
    --bg-panel: #ffffff;
    --text-primary: #37352f;
    --text-secondary: #787774;
    --border-color: #e9e9e8;

    /* Semantic Colors */
    --accent-blue: #2e8b57;
    /* EAN Theme Green/Blue mix */
    --status-red: #e03e3e;
    /* Delayed */
    --status-yellow: #d9730d;
    /* Warning */
    --status-green: #0f7b6c;
    /* Good */

    /* Layout */
    --sidebar-width: 260px;
    --panel-width: 600px;
    --header-height: 54px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    
    font-size: 15px;
    letter-spacing: -0.02em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid transparent;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.menu-category {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 12px;
    text-transform: uppercase;
}

.menu-item {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 15px;
    margin: 1px 8px;
    border-radius: 4px;
    transition: background 0.1s;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.menu-item.active {
    background-color: rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.menu-item i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
    position: relative;
    transition: margin-right 0.3s ease;
}

.main-wrapper.panel-open {
    margin-right: var(--panel-width);
}

.top-nav {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Dashboard Widgets */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.kpi-value {
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-card.warning .kpi-value {
    color: var(--status-yellow);
}

.kpi-card.danger .kpi-value {
    color: var(--status-red);
}

/* Project List Table */
.project-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.table-container {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.data-table th {
    background: var(--bg-secondary);
    text-align: left;
    padding: 10px 16px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: var(--bg-secondary);
    cursor: pointer;
}

/* Status Tags & Progress */
.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    background: #e3e2e0;
    color: var(--text-secondary);
}

.tag.blue {
    background: #e7f3f8;
    color: #2d6bba;
}

.tag.green {
    background: #eaf5eb;
    color: #0f7b6c;
}

.tag.red {
    background: #faebeb;
    color: #d93025;
}

.status-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.status-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 3px;
}

/* Slide-in Panel */
.slide-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--panel-width);
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.slide-panel.open {
    transform: translateX(0);
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.panel-close:hover {
    background: var(--bg-secondary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Panel Sections */
.detail-group {
    margin-bottom: 24px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.detail-value {
    font-size: 16px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
}

.todo-item:hover {
    background: var(--bg-secondary);
}

/* Process Stepper (Pipeline Visual) */
.stepper-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 20px 0;
    padding: 0 10px;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 60px;
    /* Text wrapping area */
}

.step-circle {
    width: 30px;
    height: 30px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #999;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 12px;
    color: #999;
    text-align: center;
    font-weight: 500;
}

/* Active/Completed States */
.step-item.active .step-circle {
    border-color: var(--accent-blue);
    background: #fff;
    color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(46, 139, 87, 0.1);
}

.step-item.active .step-label {
    color: var(--accent-blue);
    font-weight: 700;
}

.step-item.completed .step-circle {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.step-item.completed .step-label {
    color: var(--text-primary);
}

/* Hierarchy Org Chart */
.org-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
    background: #fdfdfb;
    border-radius: 12px;
}

.org-tier {
    display: flex;
}

/* Horizontal Organization Tree */
.org-tree-horizontal {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 10px;
    gap: 40px;
    overflow-x: auto;
}

.org-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    padding: 10px 0;
}

/* Vertical line connecting nodes in a column */
.org-column::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 85px;
    /* Increased to avoid sticking out above first card */
    bottom: 85px;
    /* Increased to avoid sticking out below last card */
    width: 2px;
    background: #ccc;
    display: none;
    z-index: 0;
}

.org-column:not(:first-child)::before {
    display: block;
}

.org-node {
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.org-node.no-child::after {
    display: none;
}

.org-node.ceo {
    border-left: 8px solid #2e8b57;
    min-width: 200px;
}

.org-node.exec {
    border-left: 8px solid #0052cc;
}

.org-node.chief {
    border-left: 8px solid #d9730d;
}

.org-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    background: #f0f0f0;
    border: 2px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.org-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-role-tag {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    margin-bottom: 4px;
}

.org-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #222;
}

.org-pos {
    font-size: 12px;
    color: #777;
    font-weight: 500;
}

.vertical-split-line {
    display: none;
}

.tech-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.tech-team-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.2s;
}

.tech-team-card:hover {
    transform: translateY(-2px);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    /* Ensure it's above the side panel (z-index 100) */
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.modal-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-close:hover {
    color: var(--status-red);
}

.emp-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-height: 550px;
    overflow-y: auto;
    padding: 20px;
    background: #f8faff;
}

.emp-select-card {
    display: flex;
    align-items: center;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e1edff;
    background: #fff;
    gap: 12px;
}

.emp-select-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 82, 204, 0.12);
    border-color: #0052cc;
    background: #f0f7ff;
}

.emp-photo-circle {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #f0f0f0;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.emp-photo-circle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.emp-select-name {
    font-weight: 800;
    font-size: 16px;
    color: #222;
    margin-bottom: 2px;
}

.emp-select-pos {
    font-size: 12px;
    color: #0052cc;
    font-weight: 600;
}

/* 근태 버튼 스타일 (NEW) */
.btn-attendance {
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-attendance:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-attendance:active {
    transform: translateY(0);
    box-shadow: none;
}