/* ==================================================
   MODAL SYSTEM – LIGHT THEME
   ❗ HTML / JS / CLASS 변경 없음
================================================== */

/* ===============================
   BACKDROP
=============================== */
#local-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
    z-index: 9000;
    display: none;
}

/* ===============================
   MODAL WRAPPER
=============================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9001;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ===============================
   MODAL CARD
=============================== */
.modal-content,
.modal-content.modal-card {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 24px;
    width: 520px;
    max-width: 96%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9002;
    pointer-events: auto;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}
@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: 2px;
    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;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
}

.modal-close:hover {
    color: #111827;
}

/* ===============================
   MODAL BODY
=============================== */
.modal-body {
    color: #374151;
    font-size: 14px;
}

/* ===============================
   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: 2px;
    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: #be185d;
    box-shadow: 0 0 0 2px rgba(190, 24, 93, 0.15);
}

.form-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* ===============================
   MODAL FOOTER
=============================== */
.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-footer .btn {
    flex: 1;
    height: 42px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 2px;
    border: none;
    cursor: pointer;
}

/* ===============================
   BUTTONS
=============================== */
.btn.modal-submit {
    background-color: #be185d;
    color: #ffffff;
}

.btn.modal-submit:hover {
    background-color: #9d174d;
}

.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: 2px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    cursor: pointer;
    font-weight: 600;
}

.slot-type-btn.active {
    background-color: #be185d;
    border-color: #be185d;
    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;
}


  .review-left,
  .review-right {
    width: 100%;
  }

  .modal-body{
    height: 100%;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    justify-content: space-between;
    }
    .tree-root{
        max-height: calc(100vh - 125px) !important;
        padding-bottom:10px;
    }
}

