/* ==================================================
   MODAL SYSTEM – LIGHT THEME
   ❗ HTML / JS / CLASS 변경 없음
================================================== */

/* ===============================
   BACKDROP
=============================== */
#local-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(3, 17, 32, 0.48);
    z-index: 9000;
    display: none;
}

/* ===============================
   MODAL WRAPPER
=============================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modal > .modal-content {
    margin: 0;
}
/* ===============================
   MODAL CARD
=============================== */
.modal-content,
.modal-content.modal-card {
    background-color: #ffffff;
    border: 1px solid rgba(33, 100, 168, 0.16);
    border-radius: 16px;
    padding: 0;
    width: 520px;
    max-width: 96%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9002;
    pointer-events: auto;
    box-shadow: 0 24px 60px rgba(12, 51, 92, 0.2);
}
@media (max-width: 768px) {
    .modal-content.modal-card {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
}

.custom-alert-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-alert-modal {
    width: 420px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    animation: alertPop .15s ease-out;
}

.custom-alert-body {
    padding: 24px;
    color: #111111;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-line;
}

.custom-alert-footer {
    padding: 12px 24px 20px;
    text-align: right;
}

/* ===============================
   MODAL HEADER
=============================== */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 0;
    background: linear-gradient(90deg, #0C335C 0%, #2164A8 100%);
    color: #ffffff;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.modal-header .btn {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 800;
}

.modal-header .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ===============================
   MODAL BODY
=============================== */
.modal-body {
    padding: 16px;
    background: #f3f7fb;
    color: #374151;
    font-size: 14px;
}

.modal-content > .table-scroll,
.modal-content > .table-wrap {
    margin: 16px;
}

.custom-alert-footer.modal-footer {
    border-top: 0;
    padding-top: 12px;
}

/* ===============================
   FORM ELEMENTS
=============================== */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-input,
.form-select,
textarea.form-input {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    outline: none;
    height:40px;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus,
.form-select:focus {
    border-color: #2164A8;
    box-shadow: 0 0 0 2px rgba(33, 100, 168, 0.16);
}

.form-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* ===============================
   MODAL FOOTER
=============================== */
.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(33, 100, 168, 0.12);
}

.modal-footer .btn {
    flex: 1;
    height: 42px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 18px;
    border: none;
    cursor: pointer;
}

/* ===============================
   BUTTONS
=============================== */
.btn.modal-submit {
    background-color: #2164A8;
    color: #ffffff;
}

.btn.modal-submit:hover {
    background-color:#0C335C;
}

.btn.modal-cancel {
    background-color: #e5e7eb;
    color: #111827;
}

.btn.modal-cancel:hover {
    background-color: #d1d5db;
}

/* ===============================
   SLOT TYPE BUTTONS
=============================== */
.slot-type-tabs {
    display: flex;
    gap: 10px;
}

.slot-type-btn {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    border-radius: 18px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    cursor: pointer;
    font-weight: 600;
}

.slot-type-btn.active {
    background-color: #2164A8;
    border-color: #2164A8;
    color: #ffffff;
}

.slot-type-btn.disabled,
.slot-type-btn:disabled {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===============================
   HELP / WARNING TEXT
=============================== */
.slot-test-text {
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
}

/* ===============================
   LARGE MODALS
=============================== */
.modal-content.large {
    width: 900px;
}

/* ===============================
   TABLE INSIDE MODAL
=============================== */
.modal .table-wrap {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
}

/* ===============================
   FIX Z-INDEX CONFLICT
=============================== */
.page-inner,
.slot-sticky-header,
.table-wrap {
    z-index: auto;
}
/* 테이블 전체 */
.modal table {
    background: #ffffff;
    color: #111827;
    border-collapse: collapse;
    width: 100%;
}

/* 헤더 */
.modal thead th {
    background: #f8fafc;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

/* 바디 셀 */
.modal tbody td {
    color: #111827;
    font-size: 13px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

/* hover */
.modal tbody tr:hover {
    background: #f9fafb;
}

/* 순위 강조 */
.modal td.rank {
    font-weight: 700;
    color: #111827;
}

/* 변동 컬러 */
.modal td.up {
    color: #16a34a;
    font-weight: 700;
}

.modal td.down {
    color: #dc2626;
    font-weight: 700;
}

.modal td.same {
    color: #6b7280;
}

/* 날짜 컬럼 */
.modal td.date {
    color: #6b7280;
    font-size: 12px;
}

.review-body {
  display: flex;
  gap: 12px;
}

.review-left {
    width: 45%;
    display: flex;
    flex-direction: column;
}

.review-right {
    width: 55%;
    display: flex;
    flex-direction: column;
}

.review-date-scroll {
    max-height: 280px;
    overflow-y: auto;
    margin-top:10px;
}

.review-date-scroll table {
    width: 100%;
    border-collapse: collapse;
}

.review-date-row {
    cursor: pointer;
}
.modal tr.review-date-row.active {
    background-color: rgba(250,204,21,0.15) !important;
}

.tree-root {
    max-height: calc(100vh - 125px) !important;
    padding-bottom: 10px;
}

