body {
    font-family: "Noto Sans Thai", Arial, sans-serif;
    background: linear-gradient(180deg, #eef6ff 0%, #f7fbff 44%, #ffffff 100%);
    color: #06173f;
}
.wrapper {
    background: transparent;
}
.main-sidebar {
    width: 64px !important;
    background: #09285b !important;
    box-shadow: 10px 0 30px rgba(8, 32, 73, .08);
}
.main-header {
    margin-left: 64px !important;
    min-height: 54px;
    border-bottom: 1px solid #dbeafe;
    background: rgba(255,255,255,.9) !important;
    backdrop-filter: blur(12px);
}
.content-wrapper {
    margin-left: 64px !important;
    background: transparent;
}
.content-header {
    padding: 22px 28px 12px;
}
.content {
    padding: 0 16px 28px;
}
.brand-link {
    min-height: 54px;
    padding: 9px 8px;
    border-bottom: 1px solid rgba(255,255,255,.12) !important;
    text-align: center;
}
.brand-image {
    float: none !important;
    margin: 0 !important;
    width: 44px;
    height: 34px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    opacity: 1 !important;
    max-height: none;
}
.brand-text,
.nav-sidebar .nav-link p {
    display: none !important;
}
.nav-sidebar .nav-link {
    width: 54px;
    height: 44px;
    margin: 3px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: rgba(255,255,255,.74) !important;
}
.nav-sidebar .nav-link.active,
.nav-sidebar .nav-link:hover {
    background: linear-gradient(135deg, #0f7cff, #08bdf2) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(10, 124, 255, .28);
}
.nav-sidebar .nav-icon {
    margin: 0 !important;
    font-size: 17px !important;
}
.navbar-nav .nav-link {
    color: #667085;
    font-weight: 600;
}
.lead-sm {
    color: #667085;
    font-size: 15px;
}
.campaign-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    background: #f3f8ff;
    border: 1px solid #d8e8ff;
    border-radius: 22px;
    padding: 5px 12px;
    color: #102a56;
}
.campaign-picker select {
    min-width: 210px;
    border: 0;
    background: transparent;
    font-weight: 800;
    color: #06173f;
    outline: 0;
}
.btn-primary {
    border: 0;
    background: linear-gradient(135deg, #0f75ff, #09b9ef);
    box-shadow: 0 10px 22px rgba(13, 110, 253, .18);
    font-weight: 800;
}
.metric-card {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 18px;
    min-height: 118px;
}
.metric-card strong {
    display: block;
    font-size: 30px;
    line-height: 1.1;
}
.metric-card span {
    color: #667085;
}
.table td,
.table th {
    vertical-align: middle;
}
.form-card,
.panel-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #344054;
    font-size: 12px;
}
textarea.form-control {
    min-height: 130px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(var(--stat-cols, 4), minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}
.admin-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 132px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid #d9e6fa;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(8,44,100,.07);
}
.admin-stat-card::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -42px;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: rgba(13, 99, 255, .08);
}
.admin-stat-value {
    max-width: 240px;
    color: var(--accent);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.05;
    word-break: break-word;
}
.admin-stat-label {
    margin-top: 10px;
    color: #26364f;
    font-size: 14px;
    font-weight: 900;
}
.admin-stat-hint {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
.admin-stat-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #08b9f0);
    box-shadow: 0 16px 30px rgba(13,99,255,.20);
    font-size: 20px;
}
.template-panel {
    padding: 20px;
    border: 1px solid #d9e6fa;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(8,44,100,.07);
}
.template-panel h2 {
    margin: 0 0 8px;
    color: #061743;
    font-size: 1.35rem;
    font-weight: 900;
}
.template-panel p {
    margin: 0 0 16px;
    color: #52647d;
}
.template-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.settings-template-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #d9e6fa;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(8,44,100,.06);
}
.settings-template-table th,
.settings-template-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #d9e6fa;
    text-align: left;
    vertical-align: middle;
}
.settings-template-table th {
    background: #eef6ff;
    color: #061743;
    font-size: 12px;
    font-weight: 900;
}
.settings-template-table tr:last-child td {
    border-bottom: 0;
}
.settings-template-table input,
.settings-template-table textarea,
.setting-input,
.setting-note {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cfe0f7;
    border-radius: 9px;
    background: #fff;
    color: #061743;
    font: inherit;
    font-weight: 800;
}
.setting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.settings-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}
.eyebrow {
    margin: 0 0 14px;
    color: #0b62ff;
    font-weight: 900;
    letter-spacing: 0;
}
.settings-intro {
    margin: 0;
    color: #53627c;
    font-size: 16px;
}
.view-login-btn {
    border-radius: 9px;
    padding: 11px 18px;
    white-space: nowrap;
}
.settings-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.settings-card {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    border: 1px solid #d7e7ff;
    border-radius: 10px;
    background: #fff;
    padding: 22px;
    box-shadow: 0 18px 42px rgba(38, 86, 146, .08);
}
.settings-card:after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -34px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(13,110,253,.18), rgba(13,110,253,.04));
}
.settings-card strong {
    display: block;
    max-width: 75%;
    color: #0a64ff;
    font-size: 31px;
    line-height: 1.02;
    word-break: break-word;
}
.settings-card span {
    display: block;
    margin-top: 10px;
    font-weight: 900;
}
.settings-card small {
    display: block;
    margin-top: 4px;
    color: #53627c;
    font-weight: 700;
}
.settings-card i {
    position: absolute;
    right: 28px;
    bottom: 50px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, #0f75ff, #09b9ef);
    color: #fff;
    font-size: 21px;
}
.settings-card.purple strong { color: #8457ff; }
.settings-card.purple i { background: linear-gradient(135deg, #8957ff, #22b8ff); }
.settings-card.teal strong { color: #06acd2; }
.settings-card.teal i { background: linear-gradient(135deg, #04b6d8, #18d1d1); }
.settings-card.orange strong { color: #f59f00; }
.settings-card.orange i { background: linear-gradient(135deg, #f59f00, #19c4c5); }
.settings-panel {
    border: 1px solid #d8e8ff;
    border-radius: 12px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 20px 52px rgba(38, 86, 146, .08);
    padding: 20px;
}
.settings-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}
.settings-panel h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 900;
}
.settings-panel p {
    margin: 0;
    color: #53627c;
    font-size: 15px;
}
.campaign-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 22px;
    background: #eef6ff;
    color: #0867ff;
    font-weight: 900;
    white-space: nowrap;
}
.settings-table-wrap {
    overflow-x: auto;
    border: 1px solid #d7e7ff;
    border-radius: 10px;
}
.settings-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}
.settings-table th {
    background: #eaf5ff;
    color: #06173f;
    font-size: 13px;
    padding: 12px 14px;
}
.settings-table td {
    border-top: 1px solid #d7e7ff;
    padding: 12px 14px;
    vertical-align: middle;
}
.group-pill {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0969ff;
    font-size: 12px;
    font-weight: 900;
}
.setting-input,
.setting-note {
    width: 100%;
    border: 1px solid #bfd9ff;
    border-radius: 8px;
    padding: 11px 13px;
    color: #06173f;
    font-weight: 800;
}
.setting-note {
    background: #fff;
}
.settings-actions {
    margin-top: 18px;
}
@media (max-width: 1100px) {
    .settings-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .main-sidebar {
        width: 58px !important;
    }
    .main-header,
    .content-wrapper {
        margin-left: 58px !important;
    }
    .settings-cards {
        grid-template-columns: 1fr;
    }
    .settings-hero,
    .settings-panel-head {
        display: block;
    }
    .view-login-btn,
    .campaign-badge {
        margin-top: 14px;
    }
}
