/* ============================
   GLOBAL WRAPPER
============================ */
.sms-wrapper {
    padding: 32px 40px;
    font-family: Inter, sans-serif;
    color: #1d1d1f;
}

/* ============================
   HEADER ROW (TITLE + TABS + BUTTON)
============================ */
.sms-header-row {
    display: grid;
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
}

.sms-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

/* MIDDLE TABS */
.sms-branch-tabs {
    display: flex;
    gap: 12px;
    margin-left: 45px;
}

.branch-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #D5D6D8;
    background: white;
    font-size: 14px;
    cursor: pointer;
	font-weight: 500;
    transition: 0.2s;
}

.branch-btn.active {
    background: #E7F1FF;
    color: #2563EB;
    border-color: #60A5FA;
}

/* RIGHT BUTTON + USER */
.sms-header-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn-add-message {
    background: #0587FF;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.sms-add-btn {
    background: #0587FF;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* ============================
   TABLE CONTAINER
============================ */
.sms-table-scroll {
    background: white;
    border-radius: 12px;
    padding: 0;
    overflow-y: auto;
    border: 1px solid #ECECEC;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.05);
}

/* Hide scrollbar */
.sms-table-scroll::-webkit-scrollbar {
    width: 0;
}
.sms-table-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================
   TABLE
============================ */
.sms-table-ui {
    width: 100%;
    border-collapse: collapse;
}

.sms-table-ui thead th {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    background: #F2F3F5;
    color: #6b6e72;
    text-align: left;
}

/* Rows */
.sms-table-ui td {
    padding: 18px 16px;
    font-size: 15px;
    border-bottom: 1px solid #F1F1F1;
    vertical-align: middle;
}

.sms-table-ui tr:nth-child(even) {
    background: #FAFAFA;
}

/* Column widths */
.sms-table-ui td:nth-child(1),
.sms-table-ui th:nth-child(1) { width: 26%; }

.sms-table-ui td:nth-child(2),
.sms-table-ui th:nth-child(2) { width: 17%; }

.sms-table-ui td:nth-child(3),
.sms-table-ui th:nth-child(3) { width: 14%; }

.sms-table-ui td:nth-child(4),
.sms-table-ui th:nth-child(4) { width: 18%; }

.sms-table-ui td:nth-child(5),
.sms-table-ui th:nth-child(5) { width: 13%; }

.sms-table-ui td:nth-child(6),
.sms-table-ui th:nth-child(6) { width: 12%; }

/* BADGES */
.sms-status {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.sms-pending {
    background: #FFE3D2;
    color: #E46A1F;
}

.sms-sent {
    background: #D5F5E3;
    color: #2E9A56;
}

.sms-error {
    background: #F8D7DA;
    color: #B21722;
}

.sms-deleted {
    background: #F0F2F5;
    color: #9CA3AF;
}

/* ACTION */
.sms-delete-btn {
    color: #D11A2A;
    cursor: pointer;
    font-weight: 600;
}


/* ============================
   Popup
============================ */

/* OVERLAY */
.sms-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(3px);
    z-index: 999999;

    display: flex; /* giữ flex để popup nằm giữa */
    justify-content: center;
    align-items: center;

    /* TRẠNG THÁI ẨN */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.2s ease;
}

/* TRẠNG THÁI HIỆN */
.sms-popup-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* POPUP BOX */
.sms-popup {
    width: 520px;
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0px 12px 28px rgba(0,0,0,0.12);
    animation: popupFade 0.25s ease;
}

@keyframes popupFade {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* POPUP TITLE */
.sms-popup-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* FORM GRID */
.sms-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
}

.sms-form-group.full {
    grid-column: 1 / 3;
}

.sms-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
    display: block;
}

/* INPUTS */
.sms-input,
.sms-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #E1E2E4;
    background: #FAFAFA;
}

.sms-input:focus,
.sms-textarea:focus {
    border-color: #60A5FA;
    background: white;
    outline: none;
}

.sms-textarea {
    height: 120px;
    resize: none;
}

/* FOOTER BUTTONS */
.sms-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 20px;
    background: #E6E6E6;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-submit {
    padding: 10px 24px;
    background: #0587FF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn-submit:hover {
    background: #0074e6;
}

/* TEMPLATE PAGE FIX */
.template-page .sms-header-row {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.input-disabled {
    background: #f3f4f6 !important;
    cursor: not-allowed !important;
    color: #777 !important;
}

.sms-template-tags {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sms-template-tag {
    background: #e7f1ff;
    color: #2563eb;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.sms-template-tag::before {
    content: "{ }";
    font-size: 11px;
    margin-right: 6px;
    opacity: 0.6;
}

/* Extra input */
.sms-placeholder-group {
    grid-column: 1 / 3;          /* full width */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    margin-top: 8px;             /* 👈 cách phần trên */
}


.sms-placeholder-group label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
    display: block;
}



