:root {
    --sa-navy: #0b1730;
    --sa-navy-soft: #132342;
    --sa-primary: #3157d5;
    --sa-primary-hover: #2447bd;
    --sa-cyan: #2f8ee5;
    --sa-emerald: #16a085;
    --sa-amber: #e49a29;
    --sa-danger: #df5361;
    --sa-bg: #f4f7fb;
    --sa-card: #ffffff;
    --sa-line: #e6ebf2;
    --sa-text: #172033;
    --sa-muted: #6f7c91;
    --sa-soft: #f8fafd;
    --sa-radius: 14px;
    --sa-shadow: 0 10px 30px rgba(18, 36, 68, 0.07);
}

/* Login */
.sa-login-page {
    min-height: 100vh;
    padding: 36px 24px !important;
    background:
        radial-gradient(760px 520px at 8% 14%, rgba(49, 87, 213, .32), transparent 62%),
        radial-gradient(680px 520px at 92% 84%, rgba(47, 142, 229, .18), transparent 64%),
        linear-gradient(145deg, #081329 0%, var(--sa-navy) 48%, #101f3c 100%) !important;
}

.sa-login-page::before,
.sa-login-page::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
}

.sa-login-page::before {
    width: 420px;
    height: 420px;
    left: -190px;
    bottom: -230px;
}

.sa-login-page::after {
    width: 280px;
    height: 280px;
    right: -130px;
    top: -150px;
}

.sa-login-shell {
    width: min(1080px, 100%) !important;
    max-width: 1080px !important;
    min-height: 620px !important;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px !important;
    box-shadow: 0 34px 90px rgba(0, 8, 24, .42) !important;
}

.sa-login-brand {
    flex: 1 1 auto !important;
    padding: 64px 62px 52px !important;
    background:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(155deg, #10244c 0%, #163d88 50%, #255ed1 100%) !important;
    background-size: 40px 40px, 40px 40px, auto !important;
}

.sa-login-brand::before {
    background: radial-gradient(circle at 26% 20%, rgba(79, 151, 255, .34), transparent 38%) !important;
    opacity: 1 !important;
    mask-image: none !important;
}

.sa-login-brand::after {
    width: 360px !important;
    height: 360px !important;
    right: -160px !important;
    bottom: -170px !important;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .035) !important;
}

.sa-login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 64px;
}

.sa-login-brand-mark,
.sa-login-mobile-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    color: #174398;
    background: #fff;
    font-size: 23px;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(2, 10, 28, .24);
}

.sa-login-kicker {
    color: rgba(231, 240, 255, .82);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 1.8px;
}

.sa-login-kicker span {
    display: block;
    color: rgba(206, 222, 249, .58);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.2px;
}

.sa-login-brand h1 {
    max-width: 480px;
    margin-bottom: 18px !important;
    font-size: clamp(34px, 4vw, 48px) !important;
    letter-spacing: -1.4px;
}

.sa-login-brand .desc {
    max-width: 480px !important;
    margin-bottom: 34px !important;
    color: rgba(231, 240, 255, .78) !important;
    font-size: 15px !important;
    line-height: 1.9 !important;
}

.sa-login-capabilities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 490px;
}

.sa-login-capability {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    color: #eff6ff;
    background: rgba(255, 255, 255, .075);
    backdrop-filter: blur(8px);
    font-size: 13px;
}

.sa-login-capability i {
    color: #a9cdfd;
    font-size: 18px;
}

.sa-login-brand .side-foot {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(224, 235, 252, .68) !important;
}

.sa-login-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #44d7ad;
    box-shadow: 0 0 0 5px rgba(68, 215, 173, .13);
}

.sa-login-panel {
    flex: 0 0 430px !important;
    padding: 54px 52px 46px !important;
    background: #fff !important;
}

.sa-login-mobile-brand { display: none; }

.sa-login-panel .form-head {
    margin-bottom: 28px !important;
}

.sa-login-panel .form-head h2 {
    margin-bottom: 9px !important;
    color: var(--sa-text) !important;
    font-size: 28px !important;
    letter-spacing: -.5px;
}

.sa-login-panel .form-head p {
    color: var(--sa-muted) !important;
    font-size: 14px !important;
}

.sa-login-panel .field { margin-bottom: 17px !important; }
.sa-login-panel .field label { margin-bottom: 8px !important; color: #46546a !important; }
.sa-login-panel .sa-login-control {
    width: 100%;
    max-width: 100%;
}
.sa-login-panel .sa-login-control > .el-form-item,
.sa-login-panel .sa-login-control > .captcha-row {
    width: 100%;
}
.sa-login-panel .sa-login-control > .el-form-item .el-input {
    width: 100%;
}
.sa-login-panel .captcha-row {
    box-sizing: border-box;
}
.sa-login-panel .el-input__inner {
    height: 46px !important;
    line-height: 46px !important;
    border-color: #dde4ee !important;
    border-radius: 10px !important;
    background: #fbfcfe !important;
}
.sa-login-panel .el-input__inner:focus {
    border-color: var(--sa-primary) !important;
    box-shadow: 0 0 0 3px rgba(49, 87, 213, .11) !important;
}
.sa-login-panel .captcha-img { width: 112px; height: 46px; border-radius: 10px; }
.sa-login-panel .links { margin: 2px 0 20px !important; }
.sa-login-panel .links a { color: #66748a !important; }
.sa-login-panel .links a:hover { color: var(--sa-primary) !important; }
.sa-login-panel .btn-login {
    height: 48px !important;
    border-radius: 10px !important;
    background: linear-gradient(90deg, #3157d5 0%, #2f75de 100%) !important;
    box-shadow: 0 12px 24px rgba(49, 87, 213, .23) !important;
}
.sa-login-panel .secure { margin-top: 15px !important; color: #94a0b2 !important; }

/* Shared super-admin shell */
.yb_body {
    margin-left: 216px !important;
}

.sa-admin-body {
    min-width: 0 !important;
    background: var(--sa-bg);
    color: var(--sa-text);
}

.sa-admin-body .yb_body {
    min-width: 0 !important;
    min-height: calc(100vh - 60px);
    margin-left: 216px !important;
    background: var(--sa-bg);
}

.sa-admin-body .yb_body .el-main {
    padding: 28px 30px 42px;
}

.sa-admin-body .sa-admin-shell .main {
    width: 100%;
    min-width: 0 !important;
    max-width: 1600px;
    margin: 0 auto;
}

.sa-header.header {
    height: 60px !important;
    line-height: 60px;
    border-bottom: 1px solid var(--sa-line);
    box-shadow: 0 2px 12px rgba(18, 36, 68, .04) !important;
}

.sa-header-inner { display: flex; min-width: 0; }

.sa-header .logo {
    width: 216px !important;
    flex: 0 0 216px;
    justify-content: flex-start !important;
    gap: 11px;
    padding: 0 18px !important;
    background: var(--sa-navy) !important;
}

.sa-header .sa-brand-mark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    border-radius: 10px;
    color: #3157d5;
    background: #fff;
    font-size: 18px;
    font-weight: 800;
}

.sa-header .sa-brand-mark img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.sa-brand-fallback { display: flex; align-items: center; justify-content: center; }
.sa-brand-copy { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.25; }
.sa-brand-copy span { display: block; margin-top: 2px; color: #8fa6cb; font-size: 10px; font-weight: 500; letter-spacing: .5px; }
.sa-header-greeting { padding-left: 24px; color: #26344b; font-size: 14px; font-weight: 600; }
.sa-header-actions { min-width: 0; padding-right: 20px; }
.sa-header .search-head .el-input__inner { width: 220px; height: 34px; background: #f4f7fb !important; }
.sa-header .notice, .sa-header .visitShop { color: #5f6d81; }
.sa-header .userIcon { width: 34px; height: 34px; overflow: visible; background: #edf2fa; }
.sa-header .userIcon img { width: 34px !important; height: 34px !important; border-radius: 50%; object-fit: cover; }

.sa-aside.menuleft {
    top: 60px;
    width: 216px !important;
    height: calc(100vh - 60px) !important;
    padding: 18px 12px 24px;
    border-right: none !important;
    background: var(--sa-navy) !important;
    overflow-y: auto;
}

.sa-aside .sa-nav-caption {
    padding: 0 14px 10px;
    color: #7188ae;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.sa-aside .slimScrollDiv { overflow: visible !important; }
.sa-aside .el-menu { border-right: 0; background: transparent !important; }
.sa-aside .el-menu-item,
.sa-aside .el-submenu__title {
    position: relative;
    height: 46px;
    margin: 4px 0;
    padding-left: 16px !important;
    border-radius: 9px;
    color: #a9b8d1 !important;
    line-height: 46px;
}
.sa-aside .el-menu-item i,
.sa-aside .el-submenu__title i { color: #8297ba; font-size: 17px; }
.sa-aside .el-menu-item:hover,
.sa-aside .el-submenu__title:hover { color: #fff !important; background: rgba(75, 112, 189, .18) !important; }
.sa-aside .el-menu-item.is-active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(49, 87, 213, .92), rgba(49, 87, 213, .56)) !important;
    box-shadow: 0 8px 18px rgba(2, 9, 26, .2);
}
.sa-aside .el-menu-item.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    width: 3px;
    height: 26px;
    border-radius: 0 4px 4px 0;
    background: #7fb1ff;
}
.sa-aside .el-menu-item-group__title { display: none; }
.sa-aside .el-submenu .el-menu-item { min-width: 0; padding-left: 45px !important; font-size: 13px; }

.sa-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.sa-page-heading h1 { margin: 0 0 7px; color: var(--sa-text); font-size: 24px; line-height: 1.2; }
.sa-page-heading p { margin: 0; color: var(--sa-muted); font-size: 13px; }
.sa-eyebrow { margin-bottom: 8px; color: var(--sa-primary); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }

.sa-stat-strip {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.sa-stat-card {
    min-width: 0;
    margin: 0 !important;
    padding: 20px !important;
    border: 1px solid var(--sa-line);
    border-radius: var(--sa-radius) !important;
    background: var(--sa-card);
    box-shadow: var(--sa-shadow);
}
.sa-stat-card .top-middle { margin-left: 0 !important; align-items: center; }
.sa-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-right: 14px;
    border-radius: 12px;
    color: var(--sa-primary);
    background: rgba(49, 87, 213, .1);
    font-size: 20px;
}
.sa-stat-card:nth-child(2) .sa-stat-icon { color: #637087; background: #f0f3f7; }
.sa-stat-card:nth-child(3) .sa-stat-icon { color: var(--sa-amber); background: #fff5e6; }
.sa-stat-card:nth-child(4) .sa-stat-icon { color: var(--sa-emerald); background: #eaf8f4; }
.sa-stat-label { color: var(--sa-muted); font-size: 12px; }
.sa-stat-value { margin-top: 7px; color: var(--sa-text); font-size: 25px; font-weight: 750; line-height: 1; }

.sa-platform-list .main-search,
.sa-platform-list .main-table,
.sa-platform-edit .sa-edit-card {
    border: 1px solid var(--sa-line);
    border-radius: var(--sa-radius) !important;
    background: var(--sa-card);
    box-shadow: var(--sa-shadow);
}
.sa-platform-list .main-search { margin-top: 16px !important; padding: 20px 22px !important; }
.sa-platform-list .main-table { margin-top: 16px; padding: 0 22px 20px !important; }
.sa-list-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sa-list-card-title h2 { margin: 0; color: var(--sa-text); font-size: 16px; }
.sa-list-card-title span { color: #94a0b2; font-size: 12px; }
.sa-list-toolbar { display: flex !important; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 !important; }
.sa-list-toolbar > div { margin-right: 0 !important; }
.sa-list-toolbar .elinput { width: 260px !important; }
.sa-list-toolbar .sa-date-label { color: #4d5b70; font-size: 13px; }
.sa-list-toolbar .el-date-editor { max-width: 330px; }
.sa-list-toolbar .el-input__inner,
.sa-platform-edit .el-input__inner { border-color: #dfe5ee; border-radius: 8px; }
.sa-list-toolbar .el-button,
.sa-platform-edit .el-button { border-radius: 8px; }
.sa-list-toolbar .el-button--primary,
.sa-platform-edit .el-button--primary { border-color: var(--sa-primary); background: var(--sa-primary); }
.sa-platform-table { margin-top: 0 !important; }
.sa-platform-table .el-table::before { display: none; }
.sa-platform-table .el-table th { height: 48px; color: #59677b; background: #f7f9fc; font-size: 12px; font-weight: 700; }
.sa-platform-table .el-table td { padding: 11px 0; border-bottom-color: #edf1f6; }
.sa-platform-table .el-table__row:hover > td { background: #f9fbff !important; }
.sa-platform-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 11px;
    color: var(--sa-primary);
    background: #edf2ff;
    font-weight: 700;
}
.sa-platform-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 11px; object-fit: cover; background: #fff; }
.sa-platform-name { color: #26344a; font-weight: 650; }
.sa-action-primary { color: var(--sa-primary) !important; font-weight: 650; }
.sa-action-danger { color: var(--sa-danger) !important; }
.sa-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; }
.sa-table-footer .el-col { float: none; width: auto; }

/* Platform edit */
.sa-platform-edit .sa-edit-card { overflow: hidden; }
.sa-platform-edit .main-tab { padding: 24px 28px 0 !important; border-bottom: 1px solid var(--sa-line); border-radius: 0 !important; }
.sa-edit-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.sa-edit-intro h1 { margin: 0 0 6px; color: var(--sa-text); font-size: 22px; }
.sa-edit-intro p { margin: 0; color: var(--sa-muted); font-size: 13px; }
.sa-platform-edit .main-tab .el-tabs__header { margin-bottom: 14px; }
.sa-platform-edit .main-tab .el-tabs__content { display: none; }
.sa-platform-edit .main-tab .tips { margin: 0 0 18px; padding: 10px 13px; border-radius: 8px; background: #eef4ff; }
.sa-platform-edit .main-con { padding: 24px !important; background: var(--sa-bg); }
.sa-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sa-form-section {
    min-width: 0;
    padding: 22px 24px 10px;
    border: 1px solid var(--sa-line);
    border-radius: 12px;
    background: #fff;
}
.sa-form-section.sa-form-section-wide { grid-column: 1 / -1; }
.sa-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 6px; padding-bottom: 16px; border-bottom: 1px solid #edf1f6; }
.sa-section-head h2 { margin: 0 0 5px; color: #243248; font-size: 16px; }
.sa-section-head p { margin: 0; color: #8a96a8; font-size: 12px; }
.sa-form-section > .flex-bet,
.sa-form-section > .flex.wid { padding: 13px 0 !important; }
.sa-form-section .right-left { width: 118px; flex: 0 0 118px; padding-right: 20px !important; color: #526076; font-size: 13px; }
.sa-form-section .right-width { width: auto; min-width: 0; }
.sa-form-section .elinput { width: min(100%, 420px); }
.sa-form-section .imgbox { width: 112px; height: 112px; overflow: hidden; border: 1px dashed #cad4e2; border-radius: 11px; background: #f8fafd; }
.sa-form-section .avatar-uploader .el-upload { width: 110px; height: 110px; line-height: 110px; }
.sa-form-section .avatar { width: 110px; height: 110px; object-fit: cover; }
.sa-field-help { margin: -4px 0 10px 118px; color: #8a96a8; font-size: 12px; line-height: 1.6; }
.sa-permission-groups { padding-top: 7px; }
.sa-permission-groups .el-checkbox-group { display: flex; flex-wrap: wrap; gap: 9px; }
.sa-permission-groups .el-checkbox { margin: 0 !important; border-color: #d8e1ee; border-radius: 8px; background: #fbfcfe; }
.sa-permission-groups .el-checkbox.is-checked { border-color: #9ab3ef; background: #f2f6ff; }
.sa-account-note { display: flex; align-items: center; margin-top: 7px; color: #7b889c; font-size: 12px; }
.sa-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0 !important;
    padding: 16px 24px !important;
    border-top: 1px solid var(--sa-line);
    background: rgba(255, 255, 255, .95) !important;
    backdrop-filter: blur(12px);
}
.sa-sticky-actions .el-button { min-width: 108px; }

@media (max-width: 1180px) {
    .sa-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sa-header .search-head { display: none; }
    .sa-edit-grid { grid-template-columns: 1fr; }
    .sa-form-section.sa-form-section-wide { grid-column: auto; }
}

@media (max-width: 820px) {
    .sa-login-page { justify-content: flex-start !important; padding: 20px 14px !important; }
    .sa-login-shell { max-width: 520px !important; min-height: auto !important; }
    .sa-login-brand { display: none !important; }
    .sa-login-panel { flex: none !important; width: 100% !important; padding: 34px 28px !important; }
    .sa-login-mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; color: var(--sa-text); font-weight: 750; }
    .sa-login-mobile-mark { width: 36px; height: 36px; color: #fff; background: var(--sa-primary); font-size: 18px; box-shadow: none; }
}

@media (max-width: 768px) {
    .sa-header .logo { width: 72px !important; flex-basis: 72px; justify-content: center !important; padding: 0 !important; }
    .sa-header .sa-brand-copy, .sa-header-greeting, .sa-header .notice, .sa-header .visitShop { display: none; }
    .sa-header-actions { padding-right: 8px; }
    .sa-header .el-dropdown-link { margin-right: 10px; font-size: 13px; }
    .sa-aside.menuleft { width: 72px !important; padding: 14px 8px; }
    .sa-aside .sa-nav-caption, .sa-aside .el-submenu__title a, .sa-aside .el-menu-item span, .sa-aside .el-submenu__icon-arrow { display: none; }
    .sa-aside .el-menu-item, .sa-aside .el-submenu__title { display: flex; justify-content: center; padding: 0 !important; }
    .sa-aside .el-menu-item i, .sa-aside .el-submenu__title i { margin: 0 !important; }
    .sa-aside .el-submenu .el-menu { display: none; }
    .yb_body, .sa-admin-body .yb_body { margin-left: 72px !important; }
    .sa-admin-body .yb_body .el-main { padding: 18px 14px 30px; }
    .sa-page-heading { align-items: flex-start; flex-direction: column; }
    .sa-stat-strip { grid-template-columns: 1fr; }
    .sa-list-toolbar { align-items: stretch; flex-direction: column; }
    .sa-list-toolbar .elinput, .sa-list-toolbar .el-date-editor { width: 100% !important; max-width: none; }
    .sa-platform-list .main-table { overflow-x: auto; }
    .sa-platform-table { min-width: 760px; }
    .sa-edit-intro { flex-direction: column; }
    .sa-platform-edit .main-con { padding: 14px !important; }
    .sa-form-section { padding: 18px 16px 8px; }
    .sa-form-section > .flex-bet, .sa-form-section > .flex.wid { align-items: flex-start; flex-direction: column; }
    .sa-form-section .right-left { width: auto; padding: 0 0 8px !important; text-align: left !important; }
    .sa-field-help { margin-left: 0; }
    .sa-form-section .elinput, .sa-form-section .right-width { width: 100% !important; }
    .sa-form-section .right-width .el-input[style] { width: 100% !important; }
}
