/* ============================================================
   KAKAO ALIMTALK  —  사이트 디자인 시스템 기반
   --pc1 : #f44c44  (주색 / reset.css 변수)
   --fc1  : #666    --fc2 : #999    --fc3 : #333
   ============================================================ */

/* reset.css 미로드 환경 대비 변수 fallback */
:root {
    --pc1: #f44c44;
    --fc1: #666;
    --fc2: #999;
    --fc3: #333;
}

/* reset.css 미로드 환경 대비 font-size base (reset.css가 있으면 덮어써짐) */
html { font-size: 10px; }

/* ===== 페이지 / 컨테이너 ===== */
.alimtalk-page      { padding: 40px 0 60px; }
.alimtalk-container { max-width: 140rem; margin: 0 auto; }


/* ===== 탭 네비게이션 ===== */
.alimtalk-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 24px;
}
.alimtalk-tab {
    padding: 12px 22px;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--fc1);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.alimtalk-tab:hover {
    color: var(--pc1);
    background: #ffeceb;
}
.alimtalk-tab.active {
    color: var(--pc1);
    border-bottom-color: var(--pc1);
    font-weight: 600;
}


/* ===== 전송방식 탭 ===== */
.send-mode-tabs {
    display: flex;
    gap: 6px;
}
.send-mode-tab {
    padding: 8px 18px;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--fc1);
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.send-mode-tab:hover {
    background: #ffeceb;
    border-color: var(--pc1);
    color: var(--pc1);
}
.send-mode-tab.active {
    background: var(--pc1);
    border-color: var(--pc1);
    color: #fff;
    font-weight: 600;
}


/* ===== 템플릿 유형 탭 ===== */
.tpl-type-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}
.tpl-type-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 1.3rem;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.tpl-type-tab + .tpl-type-tab {
    border-left: 1px solid #dee2e6;
}
.tpl-type-tab.active {
    background: var(--pc1);
    color: #fff;
    font-weight: 600;
}

/* ===== 공지 박스 ===== */
.notice-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #ffb300;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.notice-list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}
.notice-list li {
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--fc1);
}
.notice-list li + li  { margin-top: 4px; }
.notice-list li strong { color: var(--pc1); }


/* ===== 레이아웃 : 미리보기 + 폼 ===== */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 40px;
}
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-section-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* ===== 가이드 박스 ===== */
.guide-box-kakao {
    background: #ffeceb;
    border: 1px solid #ffccc9;
    border-radius: 6px;
    overflow: hidden;
}
.guide-header {
    padding: 12px 16px;
    background: var(--pc1);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
}
.guide-content { padding: 14px 16px; }
.guide-list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}
.guide-list li {
    margin: 6px 0;
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--fc3);
}
.guide-list li strong { color: var(--pc1); }


/* ===== 미리보기 박스 ===== */
.preview-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}


/* ===== 카카오톡 채팅 UI (발송 페이지 미리보기) ===== */
.kakao-chat-wrap        { background: #b9cdd9; min-height: 280px; }
.kakao-channel-header   { padding: 16px 12px 8px; text-align: center; font-size: 1.3rem; font-weight: 600; color: #4a4a4a; }
.kakao-chat-body        { padding: 16px 12px; }
.kakao-msg-row          { display: flex; align-items: flex-start; }
.kakao-msg-content      { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }

.sender_profile         { font-size: 1.2rem; color: var(--fc3); font-weight: 500; display: block; margin-bottom: 4px; }

.kakao-avatar-circle {
    width: 32px; height: 32px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 8px; font-weight: 700;
    letter-spacing: -0.3px;
    position: absolute;
    z-index: 1; right: -10px; top: -7px;
}
.kakao-bubble-row       { display: flex; align-items: flex-end; gap: 6px; }
.message_box {
    background: #fff;
    border-radius: 2px 12px 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 240px; min-width: 120px;
    position: relative;
}
.mssg_tit {
    background: #ffe100;
    padding: 8px 10px 8px 14px;
    font-size: 1.3rem; font-weight: 700; color: #1a1a1a;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 2px 12px 0 0;
}
.mssg_cont              { padding: 12px 14px; min-width: 212px; }
.kakao-msg-time         { font-size: 1.1rem; color: #7a7a7a; white-space: nowrap; flex-shrink: 0; padding-bottom: 2px; }

.preview-image-wrap     { margin: 8px 0; border-radius: 4px; overflow: hidden; }
.preview-image-wrap img { width: 100%; display: block; border-radius: 4px; }

.message-text {
    margin: 0;
    color: var(--fc1);
    font-size: 1.4rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 미리보기 버튼 목록 */
.previewButtonList      { margin-top: 8px; padding-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.preview-btn-item {
    display: block; width: 100%; padding: 8px 0;
    text-align: center; font-size: 1.3rem;
    color: #3c8af7;
    background: #f4f4f4;
    border-radius: 8px;
    box-sizing: border-box;
}
.preview-btn-type               { font-size: 1rem; color: var(--fc2); margin-left: 4px; }


/* ===== 폼 섹션 (카드) ===== */
.form-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
}
.section-title {
    margin: 0 0 14px 0;
    color: var(--fc3);
    font-size: 1.5rem;
    font-weight: 600;
}


/* ===== 폼 인풋 공통 ===== */
.form-select {
    flex: 1;
    height: 3.6rem;
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.4rem;
    color: var(--fc1);
    cursor: pointer;
    background: #fff;
}
.form-select:focus  { outline: none; border-color: var(--pc1); }

.form-input {
    width: 100%;
    height: 3.6rem;
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.4rem;
    color: var(--fc1);
    box-sizing: border-box;
    margin-top: 6px;
}
.form-input:focus   { outline: none; border-color: var(--pc1); }

.input-group        { display: flex; gap: 10px; align-items: center; }

.var-input-group                { margin-bottom: 12px; }
.var-input-group:last-child     { margin-bottom: 0; }
.var-input-label                { font-size: 1.3rem; font-weight: 600; color: var(--fc1); margin-bottom: 5px; display: block; }
.var-input-label span           { color: var(--pc1); }


/* ===== 버튼 : kt-btn 계열 ===== */
.kt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3.6rem;
    padding: 0 1.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: var(--fc3);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.kt-btn:hover { background: #f5f5f5; border-color: #999; }

.kt-btn-outline { padding: 0 1.6rem; }

.kt-btn-primary {
    background: var(--pc1);
    color: #fff;
    border-color: var(--pc1);
}
.kt-btn-primary:hover { background: #d63c34; border-color: #d63c34; }

.kt-btn-small {
    height: 3rem;
    padding: 0 1.2rem;
    font-size: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: var(--fc3);
    cursor: pointer;
}
.kt-btn-small:hover { background: #f5f5f5; }

.kt-btn-send {
    width: 100%;
    height: 4.5rem;
    padding: 0;
    background: var(--pc1);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.kt-btn-send:hover {
    background: #d63c34;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(244,76,68,0.3);
}

/* 템플릿 폼 모달 액션 버튼 */
.kt-btn-cancel {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.6rem; padding: 0 2rem;
    background: #f5f5f5; color: var(--fc1);
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 1.4rem; cursor: pointer;
    transition: background 0.2s;
}
.kt-btn-cancel:hover { background: #e8e8e8; }

.kt-btn-submit {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.6rem; padding: 0 2.4rem;
    background: var(--pc1); color: #fff;
    border: none; border-radius: 4px;
    font-size: 1.4rem; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.kt-btn-submit:hover    { background: #d63c34; }
.kt-btn-submit:disabled { background: #ccc; cursor: not-allowed; }

/* 테이블 관리 버튼 공통 */
.kt-btn-delete, .kt-btn-restore, .kt-btn-hard-delete,
.kt-btn-inspect, .kt-btn-inspect-cancel,
.kt-btn-approve-cancel, .kt-btn-edit {
    display: inline-flex; align-items: center; justify-content: center;
    height: 2.6rem; padding: 0 0.8rem;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 2px;
}
.kt-btn-delete          { background: #fff; color: #dc3545; border: 1px solid #dc3545; }
.kt-btn-delete:hover    { background: #dc3545; color: #fff; }
.kt-btn-restore         { background: #fff; color: #3c8af7; border: 1px solid #3c8af7; }
.kt-btn-restore:hover   { background: #3c8af7; color: #fff; }
.kt-btn-hard-delete          { background: #fff; color: #6f1a1a; border: 1px solid #6f1a1a; }
.kt-btn-hard-delete:hover    { background: #6f1a1a; color: #fff; }
.kt-btn-edit            { background: #fff; color: #28a745; border: 1px solid #28a745; }
.kt-btn-edit:hover      { background: #28a745; color: #fff; }
.kt-btn-inspect         { background: #fff; color: #fd7e14; border: 1px solid #fd7e14; }
.kt-btn-inspect:hover   { background: #fd7e14; color: #fff; }
.kt-btn-inspect-cancel  { background: #fff; color: #6c757d; border: 1px solid #6c757d; }
.kt-btn-inspect-cancel:hover { background: #6c757d; color: #fff; }
.kt-btn-approve-cancel  { background: #fff; color: #e83e8c; border: 1px solid #e83e8c; }
.kt-btn-approve-cancel:hover { background: #e83e8c; color: #fff; }

/* 템플릿 등록 / 동기화 버튼 */
.btn-tpl-create {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.6rem; padding: 0 1.8rem;
    background: var(--pc1); color: #fff;
    border: none; border-radius: 4px;
    font-size: 1.4rem; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.btn-tpl-create:hover { background: #d63c34; }

.btn-tpl-sync {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.6rem; padding: 0 1.4rem;
    background: #fff; color: var(--pc1);
    border: 1px solid var(--pc1); border-radius: 4px;
    font-size: 1.4rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.btn-tpl-sync:hover    { background: var(--pc1); color: #fff; }
.btn-tpl-sync:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-tpl-guide {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.6rem; padding: 0 1.4rem;
    background: #fff; color: #555;
    border: 1px solid #ccc; border-radius: 6px;
    font-size: 1.4rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.btn-tpl-guide:hover { background: #f5f5f5; border-color: #aaa; }

/* 안내/예시 모달 탭 */
.guide-tab-nav {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    background: #fafafa;
}
.guide-tab-btn {
    padding: 12px 16px;
    font-size: 1.3rem; font-weight: 600;
    color: #888; background: none;
    border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: -1px;
}
.guide-tab-btn:hover  { color: #444; }
.guide-tab-btn.active { color: var(--pc1); border-bottom-color: var(--pc1); }

.guide-tab-content { padding: 20px 0; }

.guide-subtab-nav {
    display: flex; gap: 6px;
    padding: 0 20px 16px;
}
.guide-subtab-btn {
    padding: 6px 14px;
    font-size: 1.2rem; font-weight: 600;
    color: #888; background: #f0f0f0;
    border: none; border-radius: 20px;
    cursor: pointer; transition: all 0.2s;
}
.guide-subtab-btn:hover  { background: #e0e0e0; color: #444; }
.guide-subtab-btn.active { background: var(--pc1); color: #fff; }

.guide-type-desc {
    padding: 14px 20px 4px;
    font-size: 1.3rem; color: #555; line-height: 1.8;
}
.guide-type-desc ul { margin: 0; padding-left: 18px; }
.guide-type-desc li { margin-bottom: 4px; }

/* 전송 불가 내용 */
.guide-restrict-wrap   { padding: 0 20px 20px; }
.guide-restrict-notice {
    background: #fff8e1; border: 1px solid #ffe082;
    border-radius: 6px; padding: 14px 16px;
    font-size: 1.3rem; color: #555; line-height: 1.8;
    margin-bottom: 16px;
}
.guide-restrict-intro  { font-size: 1.3rem; font-weight: 600; color: #e53935; margin-bottom: 12px; }
.guide-restrict-item   { margin-bottom: 14px; }
.guide-restrict-label  { font-size: 1.3rem; font-weight: 600; color: #333; margin-bottom: 6px; }
.guide-restrict-alt    { font-weight: 400; color: #888; font-size: 1.2rem; }
.guide-restrict-msg {
    background: #f7f7f7; border-left: 3px solid #e0e0e0;
    border-radius: 0 4px 4px 0; padding: 10px 14px;
    font-size: 1.25rem; color: #555; line-height: 1.8;
    white-space: pre-wrap; word-break: break-word;
}

/* 템플릿 예시 */
.guide-example-wrap {
    padding: 16px 20px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.guide-example-item[data-tpl-memo] { cursor: pointer; }
.guide-example-item[data-tpl-memo]:hover .kakao-chat-bg {
    outline: 2px solid var(--pc1);
    border-radius: 8px;
}
.guide-example-item[data-tpl-memo]:hover .guide-example-label { color: var(--pc1); }
.guide-example-label {
    font-size: 1.2rem; font-weight: 600; color: #333;
    margin-bottom: 6px;
}
.guide-example-label .guide-example-tag {
    display: inline-block;
    font-size: 1.05rem; font-weight: 400;
    background: #e8f5e9; color: #388e3c;
    border-radius: 4px; padding: 1px 6px;
    margin-left: 5px; vertical-align: middle;
}
.guide-example-notify {
    font-size: 1.05rem; color: #bbb;
    margin-bottom: 3px;
}
/* 2열 그리드 안에서 카카오 버블 컴팩트 처리 */
.guide-example-item .kakao-chat-bg {
    min-height: 0;
    padding: 14px 12px;
}
.guide-example-item .kakao-bubble       { max-width: none; }
.guide-example-item .kakao-bubble-content {
    padding: 12px 14px;
    font-size: 1.25rem;
    white-space: normal;
}
/* 알림톡 도착 노란 바 */
.kakao-bubble-notify {
    background: #FEE500;
    color: #3A1D1D;
    font-size: 1.1rem; font-weight: 700;
    padding: 5px 14px;
    border-radius: 0 12px 0 0;
}

/* 버튼 항목 추가 */
.btn-add-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 2.8rem; padding: 0 1rem;
    font-size: 1.2rem;
    background: #fff; color: var(--pc1);
    border: 1px solid var(--pc1);
    border-radius: 4px; cursor: pointer;
    transition: all 0.2s;
}
.btn-add-btn:hover { background: var(--pc1); color: #fff; }


/* ===== 테이블 ===== */
.kt-table { width: 100%; border-collapse: collapse; font-size: 1.4rem; }
.kt-table th {
    background: #f8f8f8;
    padding: 1.2rem 1.6rem;
    text-align: left;
    font-weight: 600;
    color: var(--fc2);
    border-bottom: 2px solid #ddd;
    border-top: 1px solid #ddd;
}
.kt-table td {
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--fc3);
    vertical-align: middle;
}
.kt-table tbody tr:hover td   { background: #ffeceb; }
.kt-table-empty               { text-align: center; color: var(--fc2); padding: 40px !important; }
.tpl-row                      { cursor: pointer; }
.row-deleted td               { opacity: 0.45; text-decoration: line-through; }
.row-deleted .kt-btn-restore,
.row-deleted .kt-btn-hard-delete  { opacity: 1; text-decoration: none; }


/* ===== 배지 ===== */
.kt-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}
.kt-badge-active   { background: #d4edda; color: #155724; }
.kt-badge-inactive { background: #f8d7da; color: #721c24; }
.kt-badge-pending  { background: #fff3cd; color: #856404; }
.kt-badge-reg      { background: #e2e3e5; color: #383d41; }


/* ===== 모달 (profiles) ===== */
.kt-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}
.kt-modal {
    background: #fff;
    border-radius: 8px;
    width: 460px; max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.kt-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px;
    background: #4b5055;
    color: #fff;
}
.kt-modal-header h3 { margin: 0; font-size: 1.6rem; font-weight: 600; color: #fff; }
.kt-modal-close {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: rgba(255,255,255,0.7);
    line-height: 1; padding: 0;
    transition: color 0.2s;
}
.kt-modal-close:hover { color: #fff; }
.kt-modal-body    { padding: 24px; overflow-y: auto; }
.kt-modal-desc    { margin: 0 0 16px; font-size: 1.3rem; color: var(--fc1); line-height: 1.6; }

.kt-form-row                { margin-bottom: 14px; }
.kt-form-row label          { font-size: 1.3rem; font-weight: 600; color: #444; display: block; }
.kt-required                { color: var(--pc1); }

.kt-result-box {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    font-size: 1.3rem;
}
.kt-result-row              { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.kt-result-row:last-child   { margin-bottom: 0; }
.kt-result-label            { min-width: 100px; color: #888; font-weight: 500; }
.kt-result-value            { color: var(--fc3); font-weight: 600; word-break: break-all; }

/* 스텝 인디케이터 */
.kt-steps {
    display: flex; align-items: center;
    padding: 14px 24px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}
.kt-step {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.3rem; color: #aaa; font-weight: 500;
}
.kt-step span {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #ddd; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700;
}
.kt-step.active       { color: var(--pc1); }
.kt-step.active span  { background: var(--pc1); }
.kt-step.done span    { background: #28a745; }
.kt-step-line         { flex: 1; height: 2px; background: #ddd; margin: 0 12px; }


/* ===== 미리보기 모달 (templates) ===== */
.tpl-preview-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.tpl-preview-modal {
    background: #fff;
    border-radius: 8px;
    width: 420px; max-width: 100%;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
}
.tpl-preview-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    background: #4b5055;
    color: #fff;
    font-weight: 600;
    font-size: 1.5rem;
}
.tpl-preview-close {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: rgba(255,255,255,0.7);
    line-height: 1; padding: 0;
    transition: color 0.2s;
}
.tpl-preview-close:hover     { color: #fff; }
.tpl-preview-modal-body      { overflow-y: auto; padding: 20px; }

/* 카카오톡 채팅 UI (미리보기 모달) */
.kakao-chat-bg {
    background: #b2c7d9;
    border-radius: 8px;
    padding: 20px 16px;
    min-height: 200px;
}
.kakao-message-row           { display: flex; align-items: flex-start; gap: 8px; }
.kakao-profile-icon          { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; }
.kakao-bubble-wrap           { flex: 1; min-width: 0; }
.kakao-sender-name           { font-size: 1.2rem; font-weight: 600; color: #fff; margin-bottom: 4px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.kakao-bubble {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    overflow: hidden;
    max-width: 280px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.kakao-bubble-content        { padding: 14px 16px; font-size: 1.3rem; color: var(--fc3); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.kakao-bubble-buttons        { display: flex; flex-direction: column; gap: 6px; }
.kakao-bubble #previewExtraWrap  { padding: 0 16px 6px; }
.kakao-bubble .previewButtonList { padding: 6px 8px 14px; }
.kakao-btn {
    display: block; width: 100%; padding: 10px 16px;
    text-align: center; font-size: 14px;
    color: #3a8af4; font-weight: 500;
    border: 1px solid #e8e8e8; border-radius: 8px;
    background: #fff; cursor: default;
}
.kakao-channel-desc {
    font-size: 1.1rem; color: #aaa;
    text-align: left; padding: 2px 0 4px;
}
.kakao-btn-channel {
    background: #FEE500; color: #3C1E1E; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; border-color: #FEE500;
}
.kakao-btn-channel-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; background: #3C1E1E;
    border-radius: 50%; font-size: 10px; color: #FEE500; font-weight: 700;
}
.preview-extra-wrap{
    margin-top: 6px;
}
.kakaoPreviewExtraContentWrap {
    margin-top: 6px;
}
.btn_box {
    margin-top: 8px;
}

/* ===== 템플릿 폼 모달 ===== */
.tpl-form-group              { margin-bottom: 16px; }
.tpl-form-row                { display: flex; gap: 12px; }
.tpl-form-label              { display: flex; align-items: center; gap: 5px; font-size: 1.3rem; font-weight: 600; color: #444; margin-bottom: 6px; }
.tpl-form-label .req         { color: var(--pc1); }
.tpl-form-label .tpl-info-wrap { position: relative; margin-left: auto; display: inline-flex; align-items: center; }
.tpl-info-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: #bbb; color: #fff; font-size: 1rem; font-weight: 700;
    cursor: default; line-height: 1; flex-shrink: 0;
}
.tpl-info-tooltip {
    display: none;
    position: fixed;
    width: 300px; padding: 10px 12px;
    background: #333; color: #fff;
    font-size: 1.2rem; font-weight: 400; line-height: 1.6;
    border-radius: 6px; white-space: pre-wrap; word-break: keep-all;
    z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.tpl-info-tooltip::before {
    content: ''; position: absolute; right: 8px; bottom: 100%;
    border: 6px solid transparent; border-bottom-color: #333;
}
/* 툴팁 표시는 JS에서 position:fixed 좌표 계산 후 처리 */

.tpl-form-input,
.tpl-form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.3rem;
    color: var(--fc3);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.tpl-form-input:focus,
.tpl-form-textarea:focus     { outline: none; border-color: var(--pc1); }
.tpl-form-textarea           { resize: none; }
.tpl-form-hint               { font-size: 1.1rem; color: var(--fc2); margin-top: 4px; }

/* 변수 취소 버튼 */
.btn-var-cancel {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.8rem; height: 2.8rem;
    font-size: 1.6rem; line-height: 1;
    background: #fff; color: #999;
    border: 1px solid #ddd;
    border-radius: 4px; cursor: pointer;
}
.btn-var-cancel:hover { background: #f5f5f5; color: #555; }

/* 템플릿 내용 미리보기 */
.tpl-content-preview {
    margin-top: 6px;
    padding: 10px 12px;
    background: #f8f9ff;
    border: 1px solid #e0e4f5;
    border-radius: 6px;
    font-size: 1.3rem;
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}
.tpl-var-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a6ee8;
    border: 1px solid #b3ccf8;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* 버튼 항목 행 */
.tpl-btn-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f8f8;
    position: relative;
}
.tpl-btn-item-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
    font-size: 1.2rem; font-weight: 600; color: var(--fc1);
}
.tpl-btn-remove {
    background: none; border: none;
    font-size: 16px; color: var(--fc2);
    cursor: pointer; line-height: 1; padding: 0;
    transition: color 0.2s;
}
.tpl-btn-remove:hover        { color: #dc3545; }
.tpl-btn-row                 { display: flex; gap: 8px; margin-bottom: 8px; }
.tpl-btn-row:last-child      { margin-bottom: 0; }

/* 반려 사유 박스 */
.tpl-reject-box {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 1.3rem;
    color: #c53030;
    line-height: 1.6;
}
.tpl-reject-box .reject-label {
    font-weight: 700; font-size: 1.3rem;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 4px;
}
.tpl-reject-box .reject-comment {
    white-space: pre-wrap; word-break: break-word;
    color: #742a2a;
    background: #fff;
    border-radius: 4px;
    padding: 10px 12px; margin-top: 6px;
    border: 1px solid #fed7d7;
}
.tpl-reject-box .reject-meta { font-size: 1.1rem; color: var(--fc2); margin-top: 6px; text-align: right; }

/* 이미지 업로드 */
.tpl-image-upload-area {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 100px;
    display: flex; align-items: center; justify-content: center;
}
.tpl-image-upload-area:hover,
.tpl-image-upload-area.drag-over { border-color: var(--pc1); background: #ffeceb; }
.tpl-image-icon                   { font-size: 28px; margin-bottom: 6px; }
.tpl-image-text                   { font-size: 1.3rem; font-weight: 600; color: var(--fc1); margin-bottom: 4px; }
.tpl-image-hint                   { font-size: 1.1rem; color: var(--fc2); }
.tpl-image-remove {
    display: block; margin: 10px auto 0;
    padding: 4px 12px;
    font-size: 1.2rem;
    background: #fff; color: #dc3545;
    border: 1px solid #dc3545; border-radius: 4px;
    cursor: pointer; transition: all 0.2s;
}
.tpl-image-remove:hover           { background: #dc3545; color: #fff; }


/* ===== 수신자 / 발송 섹션 ===== */
.template-select-box    { margin-top: 10px; }

.input-area             { display: flex; gap: 20px; }
.input-left,
.input-right            { flex: 1; }
.input-label            { font-weight: 600; color: var(--fc3); margin-bottom: 10px; display: block; font-size: 1.4rem; }

.phone-textarea {
    width: 100%; height: 120px;
    padding: 10px;
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 1.3rem; resize: none;
    box-sizing: border-box;
    color: var(--fc3);
}
.phone-textarea:focus   { outline: none; border-color: var(--pc1); }

.input-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
    font-weight: 600; color: var(--fc3); font-size: 1.4rem;
}

.recipient-list {
    background: #f8f8f8;
    border: 1px solid #ddd; border-radius: 4px;
    padding: 10px; height: 150px;
    overflow-y: auto;
}
.recipient-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px;
    background: #fff; border: 1px solid #ddd; border-radius: 4px;
    margin-bottom: 5px; font-size: 1.4rem;
}
.remove-btn {
    background: #dc3545; color: #fff;
    border: none; border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    padding: 0; transition: background 0.2s;
}
.remove-btn:hover       { background: #c82333; }

.empty-message          { text-align: center; color: var(--fc2); padding: 20px; font-size: 1.3rem; }

.recipient-footer {
    padding-top: 10px; border-top: 1px solid #ddd;
    font-size: 1.3rem;
    display: flex; justify-content: space-between; align-items: center;
}

.send-options           { display: flex; gap: 20px; margin-bottom: 15px; }
.radio-label,
.checkbox-label         { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 1.4rem; }
.checkbox-text          { color: var(--fc3); font-weight: 500; }
.help-text              { margin: 10px 0 0 0; font-size: 1.2rem; color: var(--fc1); }
.schedule-box           { margin-bottom: 15px; }


/* ===== 로그 섹션 ===== */
.log-section {
    background: #fff; border: 1px solid #ddd;
    border-radius: 6px; padding: 20px;
}
.log-list               { max-height: 300px; overflow-y: auto; }
.log-item {
    padding: 12px; border: 1px solid #ddd; border-radius: 4px;
    margin-bottom: 10px; background: #f8f8f8; font-size: 1.3rem;
}
.log-time               { color: var(--pc1); font-weight: 600; margin-bottom: 5px; font-size: 1.3rem; }
.log-detail             { color: var(--fc1); margin: 5px 0; font-size: 1.3rem; }
.log-status {
    display: inline-block; padding: 2px 8px;
    border-radius: 3px; font-size: 1.1rem; font-weight: 600; margin-left: 10px;
}
.log-status-success     { background: #d4edda; color: #155724; }
.log-status-error       { background: #f8d7da; color: #721c24; }


/* ===== 모달 공통 애니메이션 ===== */
@keyframes rpmFadeIn {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}


/* ===== 행별 미리보기 모달 (rpm) ===== */
#rowPreviewModal.open .rpm-dialog { animation: rpmFadeIn .18s ease-out both; }

.rpm-dialog {
    background: #fff;
    border-radius: 14px;
    width: 360px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.rpm-header {
    background: var(--pc1, #f44c44);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.rpm-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rpm-header-badge {
    background: rgba(255,255,255,.22);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #fff;
}
.rpm-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.rpm-close-btn:hover { background: rgba(255,255,255,.35); }
.rpm-subheader {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 9px 18px;
    font-size: 1.25rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.rpm-subheader strong { color: #333; font-weight: 600; }
.rpm-body { overflow-y: auto; flex: 1; }
.rpm-footer {
    border-top: 1px solid #e9ecef;
    padding: 12px 18px;
    text-align: center;
    flex-shrink: 0;
    background: #fff;
}


/* ===== 웹 그리드 모달 (gm) ===== */
#gridModal.open .gm-dialog { animation: rpmFadeIn .18s ease-out both; }

.gm-dialog {
    background: #fff;
    border-radius: 14px;
    width: 92vw;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
    overflow: hidden;
}
.gm-header {
    background: #4b5055;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.gm-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gm-header-badge {
    background: rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 1.2rem;
    color: #fff;
}
.gm-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.gm-close-btn:hover { background: rgba(255,255,255,.35); }
.gm-toolbar {
    padding: 10px 18px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #f8f9fa;
}
.gm-body { padding: 16px 18px; overflow: auto; flex: 1; }
.gm-footer {
    border-top: 1px solid #e9ecef;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #fff;
}
.gm-footer-count { font-size: 1.3rem; color: #666; }
.gm-footer-count strong { color: #333; }


/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .alimtalk-page          { padding: 20px 16px 40px; }
    .content-wrapper        { grid-template-columns: 1fr; }
    .input-area             { flex-direction: column; }
    .alimtalk-tabs          { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .alimtalk-tab           { padding: 10px 14px; font-size: 1.6rem; flex-shrink: 0; }
    .tab-label              { display: none; }
}

/* ============================================================
   발송 설정 (즉시/예약) — rcs.css 패턴 동일
   ============================================================ */
.kakao-send-set .button {
    display: flex;
    width: 100%;
    border: 1px solid #ddd;
}
.kakao-send-set .button .btn {
    flex: 1;
    padding: 1.4rem 2rem;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    border-right: 1px solid #ddd;
}
.kakao-send-set .button .btn:last-child { border-right: none; }
.kakao-send-set .btn.inactive { background-color: #f7f7f7; color: #999; }
.kakao-send-set .btn.active   { background-color: #fff; color: #f44c44; border: 1px solid #f44c44; z-index: 1; }
.kakao-send-set .btn.active:last-child { border-right: 1px solid #f44c44; }

.kakao-reserve-set {
    display: flex;
    gap: .8rem;
    margin-top: 1.2rem;
}
.kakao-reserve-set .date-set {
    display: flex;
    width: 48%;
    height: 4rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: .8rem 1rem;
    align-items: center;
}
.kakao-reserve-set .date-set a {
    width: 100%;
    display: flex;
    align-items: center;
}
.kakao-reserve-set .date-set input {
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    font-size: 1.4rem;
}
.kakao-reserve-set .date-select {
    display: flex;
    gap: .8rem;
    width: 52%;
}
.kakao-reserve-set .date-select select {
    height: 4rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: .8rem 1rem;
    width: 48%;
    font-size: 1.4rem;
}

/* 수신자 목록 결과 뱃지 */
.result-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
}
.result-success { background: #e8f4fd; color: #1a7abf; }
.result-fail    { background: #fdecea; color: #c0392b; }
.result-sending { background: #fff3e0; color: #e67e22; }

/* 수신자 목록 구분 컬럼 */
.type-alimtalk { color: #555; }
.type-replace  { color: #7b5ea7; }

/* ===== 주소록 모달 ===== */
.addr-group-item {
    padding: 9px 14px;
    font-size: 1.3rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.addr-group-item:hover  { background: #f5f5f5; }
.addr-group-item.active { background: #fff0ef; color: #e53935; font-weight: 600; }

/* ── 이모티콘 안내 버튼 ── */
.emoticon-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #fff8e1;
    border: 1px solid #f0b429;
    border-radius: 12px;
    color: #b07a00;
    font-size: 1.2rem;
    cursor: pointer;
    vertical-align: middle;
    transition: background .15s;
}
.emoticon-guide-btn:hover { background: #fff0a0; }


/* ===== 공통 유틸리티 ===== */

/* flex row: title 왼쪽 + 액션 오른쪽 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-header .section-title { margin: 0; }

/* 테이블 미리보기 스크롤 래퍼 (엑셀·그리드 미리보기 공통) */
.preview-table-wrap {
    overflow-x: auto;
    max-height: 260px;
    overflow-y: auto;
}

/* 엑셀 안내 박스 */
.excel-guide-box {
    margin-top: 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 1.3rem;
    line-height: 1.8;
}
.excel-guide-title {
    font-size: 1.35rem;
    font-weight: bold;
    margin-bottom: 10px;
}
.excel-guide-field-title {
    font-weight: bold;
    margin-bottom: 4px;
}
.excel-guide-box ul {
    margin: 0 0 10px;
    padding-left: 18px;
    color: #444;
}
.excel-guide-box ul:last-child { margin-bottom: 0; }

/* 대체문자 섹션 레이블 */
.fallback-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    display: block;
}

/* 메타 정보 보조 텍스트 */
.meta-info {
    font-size: 1.3rem;
    color: #666;
}
