/* 마일리지 관리 (관리자) — /admin/mileage, /admin/mileage/log
   색은 사이트 기본 금-갈색 토큰(패키지 관리와 동일 계열). */

.mla {
    --mla-a: #c08a2c;
    --mla-p: #7a5c1f;
    --mla-pd: #4a3712;
    --mla-as: #e8c878;
    --mla-bg: #faf6ec;
    --mla-soft: #fbf1d8;
    --mla-bd: #d8cdb2;
    --mla-bds: #b4a481;
    --mla-tx: #2b261d;
    --mla-txs: #574e3f;
    --mla-txm: #7a7060;
    --mla-ok: #2f7a3d;
    --mla-ok-bg: #e9f5eb;
    --mla-dg: #b13a2a;
    --mla-dg-bg: #fbeae6;
    --mla-info: #2b5fa3;
    --mla-info-bg: #e8f1f8;

    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 0 72px;
    color: var(--mla-tx);
    word-break: keep-all;
}

.mla * { box-sizing: border-box; }
.mla button { font-family: inherit; cursor: pointer; }
.mla input, .mla select, .mla textarea { font-family: inherit; }
.mla .mono { font-variant-numeric: tabular-nums; }
.mla .b { font-weight: 800; }
.mla .dim { color: var(--mla-txm); }
.mla .sm { font-size: 0.72rem; }
.mla .gold { color: var(--mla-pd); }
.mla .plus { color: var(--mla-ok); }
.mla .minus { color: var(--mla-dg); }
.mla .struck { text-decoration: line-through; }
.mla .r { text-align: right; }
.mla .c { text-align: center; }

/* ── 헤더 ── */
.mla-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.mla-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--mla-soft);
    color: var(--mla-pd);
    border: 1px solid var(--mla-as);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 4px 11px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.mla-head h1 { font-size: 1.8rem; font-weight: 900; margin: 0 0 6px; }
.mla-head .sub {
    color: var(--mla-txm);
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0;
    max-width: 680px;
    line-height: 1.6;
}
.mla-head .sub a { color: var(--mla-pd); font-weight: 800; }
.mla-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 버튼 ── */
.mla-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 10px;
    padding: 11px 17px;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--mla-txs);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, filter 0.15s;
}
.mla-btn.full { width: 100%; }
.mla-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.mla-btn.pri { border: none; background: linear-gradient(135deg, #8d6a24, var(--mla-pd)); color: #fff; }
.mla-btn.dark { border: none; background: var(--mla-pd); color: #fff; }
.mla-btn.ok { border: none; background: var(--mla-ok); color: #fff; }
.mla-btn.gold { border-color: var(--mla-as); background: #fff8e8; color: var(--mla-p); }
.mla-btn.danger-f { border: none; background: var(--mla-dg); color: #fff; }

/* hover 는 변형마다 따로 — 공용 hover 가 채워진 버튼의 배경을 덮으면 흰 글자가 사라진다. */
.mla-btn:not(.pri):not(.dark):not(.ok):not(.gold):not(.danger-f):hover:not(:disabled) { background: var(--mla-bg); }
.mla-btn.pri:hover:not(:disabled) { filter: brightness(1.1); }
.mla-btn.dark:hover:not(:disabled) { background: #3a2b0e; }
.mla-btn.ok:hover:not(:disabled) { background: #26642f; }
.mla-btn.gold:hover:not(:disabled) { background: #ffefcd; }
.mla-btn.danger-f:hover:not(:disabled) { background: #8c2b1e; }

.mla-sbtn {
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 7px;
    padding: 6px 11px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--mla-txs);
    margin-left: 4px;
}
.mla-sbtn.danger { border-color: #e4b5ab; color: var(--mla-dg); }
.mla-sbtn:not(.danger):hover:not(:disabled) { background: var(--mla-bg); }
.mla-sbtn.danger:hover:not(:disabled) { background: var(--mla-dg-bg); }
.mla-sbtn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 토글 */
.mla-tgl {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid var(--mla-bd);
    background: #efe9dc;
    position: relative;
    padding: 0;
}
.mla-tgl .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: left 0.15s;
}
.mla-tgl.on { background: var(--mla-p); border-color: var(--mla-pd); }
.mla-tgl.on .knob { left: 18px; }

/* ── 탭 ── */
.mla-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--mla-bd);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.mla-tab {
    background: transparent;
    border: none;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--mla-txm);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mla-tab.on { color: var(--mla-pd); border-bottom-color: var(--mla-a); }
.mla-tab .c {
    background: var(--mla-bg);
    border: 1px solid var(--mla-bd);
    color: var(--mla-txm);
    font-size: 0.68rem;
    font-weight: 900;
    padding: 1px 8px;
    border-radius: 999px;
}
.mla-tab.on .c { background: var(--mla-as); border-color: var(--mla-a); color: var(--mla-pd); }

/* ── 메시지 ── */
.mla-msg {
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.86rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
}
.mla-msg.ok { background: var(--mla-ok-bg); border: 1px solid #bfe0c6; color: #22602e; }
.mla-msg.err { background: var(--mla-dg-bg); border: 1px solid #f0cdc4; color: #8c2b1e; }

/* ── KPI ── */
.mla-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 18px;
}
.mla-kpi {
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 13px;
    padding: 14px 15px;
}
.mla-kpi.gold { background: linear-gradient(135deg, var(--mla-soft), #f7e7c4); border-color: var(--mla-as); }
.mla-kpi .lab { font-size: 0.72rem; font-weight: 800; color: var(--mla-txs); margin-bottom: 6px; }
.mla-kpi.gold .lab { color: var(--mla-pd); }
.mla-kpi .val { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.mla-kpi .val .sub { font-size: 0.78rem; font-weight: 800; }

/* ── 패널 ── */
.mla-panel {
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 18px;
}
.mla-panel.tight { padding: 16px 18px; }
.mla-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.mla-panel-head h2 { margin: 0; font-size: 1.1rem; font-weight: 900; }
.mla-panel-head .hint { font-size: 0.76rem; font-weight: 600; color: var(--mla-txm); }
.mla-panel-head .cnt {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--mla-pd);
    background: var(--mla-soft);
    border: 1px solid var(--mla-as);
    border-radius: 999px;
    padding: 2px 9px;
}

/* ── 월 초기화 확인 바 ── */
.mla-confirm {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 14px 16px;
    background: var(--mla-dg-bg);
    border: 1px solid #f0cdc4;
    border-radius: 11px;
}
.mla-confirm .cf-tx {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1.6;
    color: #7e2c20;
}
.mla-confirm .cf-tx b { font-weight: 900; }
.mla-confirm .cf-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mla-confirm .cf-btns .mla-btn { margin-bottom: 0; }

.mla-reset-note {
    margin: 0 0 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--mla-txm);
}
.mla-reset-note b { font-weight: 900; color: var(--mla-txs); font-variant-numeric: tabular-nums; }

@media (max-width: 680px) {
    .mla-confirm .cf-btns { width: 100%; }
    .mla-confirm .cf-btns .mla-btn { flex: 1; }
}

.mla-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.mla-filters select { width: auto; }

/* ── 폼 ── */
.mla .f { margin-bottom: 12px; }
.mla label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--mla-txs);
    margin-bottom: 6px;
}
.mla input, .mla select, .mla textarea {
    width: 100%;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--mla-tx);
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 9px;
    padding: 10px 12px;
}
.mla input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--mla-p); }
.mla textarea { resize: vertical; }
.mla input::placeholder, .mla textarea::placeholder { color: #a39784; font-weight: 500; }
.mla input:focus, .mla select:focus, .mla textarea:focus {
    outline: 2px solid var(--mla-as);
    outline-offset: 1px;
    border-color: var(--mla-a);
}

.mla-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mla-row .f { margin-bottom: 0; }
.mla-row > .mla-btn { margin-bottom: 0; }
.mla-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mla-grid4 .span2 { grid-column: span 2; }

.mla-form {
    margin-top: 18px;
    padding: 20px;
    background: #fcf8ee;
    border: 1px solid #ece4d2;
    border-radius: 13px;
}
.mla-form-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.mla-form-head h3 { margin: 0; font-size: 0.98rem; font-weight: 900; }
.mla-form-head .hint { font-size: 0.74rem; font-weight: 600; color: var(--mla-txm); }
.mla-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.mla-form-btns { display: flex; gap: 9px; margin-left: auto; }
.mla-note {
    margin: 10px 0 0;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--mla-txm);
    line-height: 1.65;
    max-width: 640px;
}
.mla-note b { color: var(--mla-txs); }

/* 색 선택 */
.mla-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.mla-color {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid transparent;
    padding: 0;
}
.mla-color.on { border-color: var(--mla-tx); box-shadow: 0 0 0 2px #fff inset; }

/* 세그먼트 */
.mla-seg {
    display: flex;
    gap: 6px;
    background: #f3eee0;
    border: 1px solid var(--mla-bd);
    border-radius: 10px;
    padding: 4px;
}
.mla-seg button {
    flex: 1;
    background: transparent;
    color: var(--mla-txs);
    border: none;
    border-radius: 7px;
    padding: 9px 0;
    font-size: 0.84rem;
    font-weight: 700;
}
.mla-seg button.on { background: var(--mla-p); color: #fff; font-weight: 800; }
.mla-seg button.on.danger { background: var(--mla-dg); }

/* ── 표 ── */
.mla-table-wrap { border: 1px solid #ece4d2; border-radius: 12px; overflow-x: auto; }
.mla-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.mla-table thead tr { background: var(--mla-bg); border-bottom: 1px solid var(--mla-bd); }
.mla-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--mla-txs);
    padding: 11px 13px;
    white-space: nowrap;
}
.mla-table th.r { text-align: right; }
.mla-table th.c { text-align: center; }
.mla-table td {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mla-txs);
    padding: 11px 13px;
    border-bottom: 1px solid #f2ecde;
    vertical-align: middle;
}
.mla-table tbody tr:last-child td { border-bottom: none; }
.mla-table tbody tr.on { background: var(--mla-soft); }
.mla-table tbody tr.dimrow { background: #fcf9f2; color: var(--mla-txm); }
.mla-table.rows tbody tr { cursor: pointer; }
.mla-table.rows tbody tr:not(.on):hover { background: var(--mla-bg); }
.mla-table.rows tbody tr.on:hover { background: #f7e7c4; }
.mla-empty-row {
    text-align: center;
    color: var(--mla-txm);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 26px 0 !important;
}
.mla-empty {
    background: var(--mla-bg);
    border: 1px dashed var(--mla-bd);
    border-radius: 12px;
    padding: 30px 18px;
    text-align: center;
    color: var(--mla-txm);
    font-size: 0.84rem;
    font-weight: 700;
}
.mla-empty.sm { padding: 20px; font-size: 0.8rem; }

.mla-sw { display: block; width: 24px; height: 24px; border-radius: 7px; }
.mla-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 6px;
    padding: 3px 8px;
    background: #f3eee0;
    border: 1px solid var(--mla-bd);
    color: var(--mla-txs);
    white-space: nowrap;
}
.mla-tag.danger { background: var(--mla-dg-bg); border-color: #f0cdc4; color: var(--mla-dg); }
.mla-kind {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 800;
    border: 1px solid;
    border-radius: 6px;
    padding: 2px 7px;
    background: #fff;
    white-space: nowrap;
}
.mla-rsum { font-size: 0.76rem; font-weight: 600; color: var(--mla-txs); margin-top: 4px; }
.mla-period { font-size: 0.7rem; font-weight: 700; color: #8a4a1f; margin-top: 3px; }
.mla-kind2 {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 6px;
    padding: 3px 8px;
    background: #f3eee0;
    border: 1px solid var(--mla-bd);
    color: var(--mla-txs);
    white-space: nowrap;
}
.mla-kind2.pkg { background: var(--mla-soft); border-color: var(--mla-as); color: var(--mla-pd); }
.mla-kind2.grant { background: var(--mla-info-bg); border-color: #c2daea; color: var(--mla-info); }
.mla-kind2.plus { background: var(--mla-ok-bg); border-color: #bfe0c6; color: var(--mla-ok); }
.mla-kind2.minus { background: var(--mla-dg-bg); border-color: #f0cdc4; color: var(--mla-dg); }

/* ── 페이저 ── */
.mla-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 4px 0;
    flex-wrap: wrap;
}
.mla-pager .info { font-size: 0.76rem; font-weight: 700; color: var(--mla-txm); font-variant-numeric: tabular-nums; }
.mla-pager .pages { display: flex; gap: 6px; }
.mla-pager .pg {
    background: #fff;
    border: 1px solid var(--mla-bd);
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--mla-txs);
}
.mla-pager .pg:hover:not(:disabled) { background: var(--mla-bg); }
.mla-pager .pg:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── 수동 지급 레이아웃 ── */
.mla-grant { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.mla-grant > .mla-panel:first-child { flex: 999 1 560px; min-width: 0; }
.mla-grant > .mla-panel:last-child { flex: 1 1 340px; min-width: 0; }

.mla-preview {
    background: var(--mla-soft);
    border: 1px solid var(--mla-as);
    border-radius: 11px;
    padding: 14px 15px;
    margin-bottom: 14px;
}
.mla-preview .k { font-size: 0.72rem; font-weight: 800; color: var(--mla-pd); margin-bottom: 7px; }
.mla-preview .v {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--mla-pd);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}
.mla-preview ul {
    margin: 0;
    padding-left: 16px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--mla-txs);
    line-height: 1.75;
}
.mla-preview .warn { margin: 0; font-size: 0.76rem; font-weight: 700; color: #8c2b1e; line-height: 1.6; }

/* ── 로그 레이아웃 ── */
.mla-log { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.mla-log > .mla-panel:first-child { flex: 999 1 600px; min-width: 0; }
.mla-log > .mla-panel.detail { flex: 1 1 330px; min-width: 0; border-color: var(--mla-as); }

.mla-meta2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.mla-meta2 .m { background: var(--mla-bg); border: 1px solid #ece4d2; border-radius: 9px; padding: 10px 12px; }
.mla-meta2 .k { font-size: 0.68rem; font-weight: 800; color: var(--mla-txs); }
.mla-meta2 .v { font-size: 0.86rem; font-weight: 800; margin-top: 3px; }

.mla-dl { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.mla-dl dt { font-size: 0.7rem; font-weight: 800; color: var(--mla-txm); padding-top: 2px; }
.mla-dl dd { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--mla-txs); word-break: break-all; }
.mla-detail-btns { display: flex; flex-direction: column; gap: 8px; }

/* ── 반응형 ── */
@media (max-width: 1100px) {
    .mla-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mla-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mla-grid4 .span2 { grid-column: span 2; }
}
@media (max-width: 680px) {
    .mla { padding: 8px 0 56px; }
    .mla-head h1 { font-size: 1.5rem; }
    .mla-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mla-grid4 { grid-template-columns: 1fr; }
    .mla-grid4 .span2 { grid-column: span 1; }
    .mla-panel { padding: 18px 16px; }
    .mla-form { padding: 16px; }
    .mla-form-btns { margin-left: 0; width: 100%; }
    .mla-form-btns .mla-btn { flex: 1; }
    .mla-dl { grid-template-columns: 1fr; gap: 2px 0; }
    .mla-dl dd { margin-bottom: 8px; }
}

/* 세이브코드 프리셋 블록 */
.mla-code-box {
    background: #fff;
    border: 1px solid var(--mla-as);
    border-radius: 11px;
    padding: 15px 16px;
    margin-bottom: 12px;
}
.mla-code-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.mla-code-head h4 { margin: 0; font-size: 0.9rem; font-weight: 900; color: var(--mla-pd); }
.mla-code-head .hint { font-size: 0.72rem; font-weight: 600; color: var(--mla-txm); }
.mla-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.mla-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mla-bg);
    border: 1px solid #ece4d2;
    border-radius: 9px;
    padding: 7px 9px;
}
.mla-slot .no {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--mla-p);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mla-slot input { flex: 0 0 90px; padding: 7px 9px; font-size: 0.8rem; }
.mla-slot .nm {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--mla-txs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 880px) {
    .mla-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .mla-slots { grid-template-columns: 1fr; }
}
