.set-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.set-tab {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.set-tab:hover { border-color: var(--primary); }
.set-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.set-panel { padding: 24px; }
.set-panel[hidden] { display: none; }
.set-panel h2 { margin: 0 0 4px; }
.set-panel h3 { margin: 24px 0 10px; font-size: 1rem; }
.set-panel > .muted, .set-panel form > .muted { margin: 4px 0 16px; }

.set-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.set-error { margin: 12px 0 0; color: #d64545; font-size: 0.9rem; }

.set-logo {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.set-logo p { margin: 4px 0 10px; }
.set-logo-preview {
    flex: none;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    font-size: 1.8rem;
}

.set-fee-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.set-fee-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.set-fee-card h3 { margin: 0 0 10px; }
.set-fee-row {
    display: grid;
    grid-template-columns: 1fr 120px 28px;
    gap: 8px;
    margin-bottom: 8px;
}
.set-panel input[type="text"],
.set-panel input[type="number"],
.set-panel input[type="tel"],
.set-panel input[type="email"] {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
}
.set-icon-button {
    border: 0;
    background: none;
    color: #d64545;
    font-size: 1.1rem;
    cursor: pointer;
}
.set-fee-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-weight: 700;
}
.set-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    cursor: pointer;
}

.set-table { min-width: 0; }
.set-table th.num, .set-table td.num { text-align: right; }
.set-table td input { max-width: 260px; }

.set-backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.set-danger {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.set-danger > div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.set-danger p { margin: 4px 0 10px; }
.set-danger input { margin-bottom: 10px; max-width: 220px; }
.secondary-button.danger { color: #d64545; }
.secondary-button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 800px) {
    .set-fee-grid, .set-danger { grid-template-columns: 1fr; }
    .set-logo { flex-direction: column; }
}

/* Excel import */
.imp-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 8px; }
.imp-stats div { flex: 1 1 140px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; }
.imp-stats strong { font-size: 1.5rem; }
.imp-stats span { color: var(--muted); font-size: 0.85rem; }
.imp-stats .good strong { color: var(--success); }
.imp-stats .bad strong { color: #d64545; }
.imp-table { max-height: 420px; overflow: auto; margin-top: 12px; }
.imp-row-bad { background: #fff6f6; }
.imp-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.imp-badge.good { background: #e6f7f0; color: var(--success); }
.imp-badge.bad { background: #fde8e8; color: #d64545; }
.imp-note { margin-top: 4px; font-size: 0.8rem; color: #d64545; }
.imp-done { margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; background: #e6f7f0; color: var(--success); font-weight: 600; }
.imp-done[hidden], #impResult[hidden] { display: none; }

/* Class promotion */
.promo-h { margin: 22px 0 8px; font-size: 1.05rem; }
.promo-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.promo-last { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.promo-last[hidden] { display: none; }
.promo-arrow { color: var(--muted); padding: 0 4px; }
.promo-out { color: #b8741a; font-weight: 600; }
.promo-hold { color: #d64545; font-weight: 600; }
#promoResult[hidden] { display: none; }

#tImpResult[hidden] { display: none; }

#fImpResult[hidden] { display: none; }

/* Duplicate checker */
#dupResult[hidden] { display: none; }
.imp-stats .warn strong { color: #b8741a; }
.imp-badge.warn { background: #fff3dc; color: #b8741a; }
.dup-card { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.dup-card.high { border-color: #f0b4b4; }
.dup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.dup-why { color: var(--muted); font-size: 0.88rem; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dup-danger { color: #d64545; }
.dup-foot { margin-top: 10px; display: flex; justify-content: flex-end; }

/* Phone tab strip: one scrollable line instead of five wrapped rows */
@media screen and (max-width: 700px) {
    .set-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -4px 14px;
        padding: 2px 4px 8px;
    }
    .set-tabs::-webkit-scrollbar { display: none; }
    .set-tab { flex: none; white-space: nowrap; }
}

/* Excel export (Settings -> Backup & Restore) */
.set-backup-actions label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}
.set-backup-actions input[type="date"],
.set-backup-actions select {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}
.set-backup-actions input[type="date"]:focus,
.set-backup-actions select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
.set-backup-actions input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
@media (max-width: 640px) {
    .set-backup-actions label { width: 100%; justify-content: flex-start; }
    .set-backup-actions label select { flex: 1; min-width: 0; }
    .set-backup-actions label input[type="date"] { flex: 1; min-width: 0; }
}
