/* 1단계 보안 인증 화면 (Auth Lock Overlay) */
.auth-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #030712 !important;
    backdrop-filter: blur(25px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999999 !important;
}
.auth-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.auth-card {
    width: 90%;
    max-width: 420px;
    background: #0b1329;
    border: 2px solid #38bdf8;
    border-radius: 14px;
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.4), 0 20px 60px rgba(0, 0, 0, 0.9);
    padding: 30px 26px;
    text-align: center;
}

.auth-icon { font-size: 38px; margin-bottom: 8px; }
.auth-title { font-size: 20px; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.auth-subtitle { font-size: 13px; color: #38bdf8; font-weight: 700; margin-top: 4px; margin-bottom: 22px; }

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* 화면 정중앙 커스텀 다이얼로그 (Custom Center Dialog Modal) */
.dialog-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(3, 7, 18, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999999 !important;
}
.dialog-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.dialog-box {
    width: 90%;
    max-width: 440px;
    background: #0f172a;
    border: 2px solid #38bdf8;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.4), 0 20px 50px rgba(0, 0, 0, 0.9);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: dialogPop 0.15s ease-out;
}

@keyframes dialogPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dialog-icon { font-size: 22px; }
.dialog-title { font-size: 16px; font-weight: 800; color: #fff; }

.dialog-message {
    font-size: 14.5px;
    color: #e2e8f0;
    line-height: 1.55;
    word-break: keep-all;
}

.dialog-input-wrap {
    margin-top: 4px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}


.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(3, 7, 18, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999999 !important;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.modal-card {
    position: relative;
    width: 95%;
    max-width: 1120px;
    max-height: 92vh;
    overflow-y: auto;
    background: #0b1329;
    border: 2px solid #38bdf8;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.3);
    padding: 22px 26px;
    font-size: 14px;
    color: #f8fafc;
}

/* 5대 프로젝트 관리 메인 탭바 (Main Project Tabs) */
.pm-tab-bar {
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    overflow-x: auto;
}

.pm-tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.pm-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.pm-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.pm-tab-content {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.pm-tab-content.active {
    display: flex;
}

/* 수지/예산 테이블 공통 스타일 */
.finance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;
    overflow: hidden;
}
.finance-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    font-weight: 700;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.finance-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}
.finance-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Form Styles */
.form-section {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1.1fr;
    gap: 10px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
}

.form-input, .form-select, .form-textarea {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Tab buttons */
.tab-btn-modal {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 13.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tab-btn-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.tab-btn-modal.active {
    background: #0284c7;
    color: #fff;
    border-color: #38bdf8;
    font-weight: 800;
}

/* Event Item & Buttons (Slim Vertical Height, Maximized Visible Count) */
.event-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 10px !important;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    min-height: 28px;
    box-sizing: border-box;
}

.btn-toggle-status {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 12.5px;
    font-weight: 700;
    padding: 1px 7px !important;
    height: 23px;
    line-height: 19px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s ease;
}
.btn-toggle-status:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.btn-toggle-status.active-prog {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #a7f3d0;
    font-weight: 800;
}
.btn-toggle-status.active-plan {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fde68a;
    font-weight: 800;
}
.btn-toggle-status.active-comp {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #bfdbfe;
    font-weight: 800;
}

/* Modal Schedule Bar Badges (초록-설계, 빨강-인허가, 파랑-공사, 보라-기획, 회색-홀딩, 흰색-사후관리) */
.bar-green { background: #059669; color: #ecfdf5; border: 1px solid #10b981; }      /* 초록 - 설계 */
.bar-red { background: #dc2626; color: #fef2f2; border: 1px solid #ef4444; }        /* 빨강 - 인허가 */
.bar-blue { background: #2563eb; color: #eff6ff; border: 1px solid #3b82f6; }       /* 파랑 - 공사 */
.bar-purple { background: #7c3aed; color: #f5f3ff; border: 1px solid #8b5cf6; }     /* 보라 - 기획 */
.bar-gray { background: #475569; color: #f1f5f9; border: 1px solid #64748b; }       /* 회색 - 홀딩 */
.bar-white { background: #f8fafc; color: #0f172a; border: 1px solid #cbd5e1; }      /* 흰색 - 사후관리 */
.bar-cyan { background: #0891b2; color: #ecfeff; border: 1px solid #06b6d4; }



.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-save {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    border: 1px solid #38bdf8;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}
.btn-save:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.btn-cancel:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile & Tablet Modal Responsive */
@media (max-width: 768px) {
    .modal-card, .dialog-box {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 94vh !important;
        border-radius: 8px !important;
    }
    .modal-header {
        padding: 12px 14px !important;
    }
    .modal-header h3 {
        font-size: 14.5px !important;
    }
    .modal-body {
        padding: 12px 14px !important;
        gap: 10px !important;
    }
    .modal-footer {
        padding: 10px 14px !important;
    }
    .btn-save, .btn-cancel {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
    .auth-card {
        width: 92% !important;
        padding: 22px 18px !important;
    }
    /* Modal internal 2-column grids collapse to 1 column on mobile */
    .mem-edit-section div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

