:root {
    --bg: #f7f8fb;
    --surface: #fff;
    --surface-2: #fbfbfd;
    --ink: #17181d;
    --muted: #737783;
    --muted-2: #9a9da8;
    --line: #e7e8ee;
    --line-strong: #dfe1e8;
    --purple: #5b4bc4;
    --purple-dark: #4939ae;
    --purple-soft: #f2efff;
    --green: #16835a;
    --green-soft: #e8f7f0;
    --red: #b33d48;
    --red-soft: #fff0f1;
    --amber: #9b6b00;
    --amber-soft: #fff6df;
    --shadow-xs: 0 1px 2px rgba(16,24,40,.04);
    --shadow-sm: 0 6px 20px rgba(20,24,40,.06);
    --shadow-md: 0 18px 50px rgba(20,24,40,.10);
    --radius: 14px;
    --sidebar: 252px;
    --topbar: 72px
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter,Arial,sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased
}

    body.modal-open, body.menu-open {
        overflow: hidden
    }

a {
    color: inherit;
    text-decoration: none
}

button, input, select, textarea {
    font: inherit
}

button {
    cursor: pointer
}

/* App shell */
.shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    z-index: 70;
    display: flex;
    flex-direction: column;
    background: #fbfaf6;
    border-right: 1px solid #e8e7e1;
    transition: width .24s ease,transform .24s ease;
    overflow: hidden
}

.brand {
    height: var(--topbar);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid #ecebe6;
    flex: none
}

.brand-icon {
    width: 48px;
    height: 48px;
    display: block;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg,#6554d1,#5342bd);
    color: #fff;
    font-family: "DM Sans",Inter,sans-serif;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 7px 16px rgba(91,75,196,.20);
    object-fit: contain;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    white-space: nowrap
}

    .brand-copy strong {
        font-family: "DM Sans",Inter,sans-serif;
        font-size: 15px
    }

    .brand-copy small {
        font-size: 10px;
        color: #8c8e96;
        margin-top: 4px
    }

.sidebar-nav {
    padding: 23px 13px
}

.nav-label {
    padding: 0 12px 9px;
    margin-top: 13px;
    color: #9b9d9f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em
}

    .nav-label:first-child {
        margin-top: 0
    }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    margin: 3px 0;
    border-radius: 10px;
    color: #666a73;
    font-size: 13px;
    font-weight: 500;
    transition: background .18s,color .18s,transform .18s
}

    .nav-item:hover {
        background: #f0eee8;
        color: var(--ink);
        transform: translateX(2px)
    }

    .nav-item.active {
        background: var(--purple-soft);
        color: var(--purple);
        font-weight: 650
    }

        .nav-item.active:before {
            content: "";
            position: absolute;
            left: -13px;
            top: 9px;
            bottom: 9px;
            width: 3px;
            border-radius: 0 4px 4px 0;
            background: var(--purple)
        }

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: inherit;
    flex: none
}

.nav-text {
    white-space: nowrap
}

.main {
    width: calc(100% - var(--sidebar));
    margin-left: var(--sidebar);
    min-width: 0;
    transition: margin-left .24s ease,width .24s ease
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px)
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    display: grid;
    place-content: center;
    gap: 4px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: .18s;
    flex: none
}

    .sidebar-toggle:hover {
        border-color: #cbc6e9;
        background: #faf9ff;
        box-shadow: var(--shadow-xs)
    }

    .sidebar-toggle span {
        display: block;
        width: 16px;
        height: 1.5px;
        border-radius: 2px;
        background: #4f525b
    }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 13px;
    color: #8b8e97
}

    .breadcrumb strong {
        color: #1c1e24;
        font-weight: 650;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

    .breadcrumb i {
        font-style: normal;
        color: #c3c5cb
    }

.profile-wrap {
    position: relative
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 6px 4px 6px 8px;
    border-radius: 12px
}

    .profile-trigger:hover {
        background: #f6f6f8
    }

.profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 11px
}

.profile-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15
}

    .profile-copy strong {
        font-size: 12px;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .profile-copy small {
        font-size: 10px;
        color: #8d9098;
        margin-top: 4px
    }

.profile-chevron {
    font-size: 15px;
    color: #8b8e97;
    margin-left: 2px
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 285px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px) scale(.98);
    transform-origin: top right;
    transition: .16s ease;
    z-index: 100
}

    .profile-menu.open {
        opacity: 1;
        visibility: visible;
        transform: none
    }

.profile-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px
}

    .profile-menu-head > div {
        min-width: 0;
        display: flex;
        flex-direction: column
    }

    .profile-menu-head strong {
        font-size: 12px
    }

    .profile-menu-head small {
        font-size: 10px;
        color: var(--muted);
        margin-top: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

.profile-divider {
    height: 1px;
    background: var(--line);
    margin: 7px 0
}

.profile-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 8px;
    margin-bottom: 4px
}

.profile-meta-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: var(--green-soft);
    color: var(--green);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700
}

.profile-meta div {
    display: flex;
    flex-direction: column
}

.profile-meta strong {
    font-size: 11px
}

.profile-meta small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px
}

.profile-logout-form {
    margin: 0
}

.profile-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    padding: 10px 9px;
    text-align: left;
    font-size: 12px
}

    .profile-action:hover {
        background: var(--red-soft)
    }

.danger-action {
    color: var(--red)
}

.content {
    width: min(1360px,100%);
    margin: 0 auto;
    padding: 36px 44px 56px
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px
}

    .page-head h1 {
        margin: 0 0 7px;
        font-family: "DM Sans",Inter,sans-serif;
        font-size: 32px;
        line-height: 1.1;
        letter-spacing: -.03em
    }

    .page-head p, .muted {
        margin: 0;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.55
    }

/* Buttons / fields */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 10px;
    padding: 0 15px;
    color: #4f535d;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    transition: .18s
}

    .btn:hover {
        border-color: #cfd1d9;
        background: #fafbfc;
        transform: translateY(-1px)
    }

    .btn.primary {
        background: var(--purple);
        border-color: var(--purple);
        color: #fff;
        box-shadow: 0 7px 18px rgba(91,75,196,.18)
    }

        .btn.primary:hover {
            background: var(--purple-dark);
            border-color: var(--purple-dark)
        }

    .btn.danger {
        background: var(--red);
        border-color: var(--red);
        color: #fff
    }

    .btn.full {
        width: 100%;
        margin-top: 16px
    }

    .btn.smallbtn {
        min-height: 34px;
        padding: 0 11px;
        font-size: 11px
    }

input, select, textarea {
    width: 100%;
    border: 1px solid #dfe1e7;
    border-radius: 10px;
    background: #fff;
    color: #25272d;
    padding: 11px 12px;
    outline: none;
    transition: border-color .16s,box-shadow .16s,background .16s;
    font-size: 12px
}

    input:hover, select:hover, textarea:hover {
        border-color: #cfd2db
    }

    input:focus, select:focus, textarea:focus {
        border-color: #8d80dd;
        box-shadow: 0 0 0 4px rgba(91,75,196,.10)
    }

    input[readonly] {
        background: #f7f7f9;
        color: #7c7f88
    }

.form-card label {
    display: block;
    margin-bottom: 7px;
    color: #555861;
    font-size: 11px;
    font-weight: 650
}

.validation {
    padding: 10px 12px;
    border: 1px solid #f0cdd1;
    background: var(--red-soft);
    border-radius: 9px;
    color: var(--red);
    font-size: 11px;
    margin: 0 0 16px
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px
}

.inline {
    display: inline
}

.link-btn {
    border: 0;
    background: none;
    color: var(--purple);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 4px
}

    .link-btn:hover {
        text-decoration: underline
    }

    .link-btn.danger {
        color: var(--red)
    }

/* Business cards */
.section {
    margin: 32px 0
}

.section-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px
}

    .section-head h2 {
        margin: 0;
        font-size: 13px;
        letter-spacing: .08em;
        font-weight: 750
    }

.count {
    background: #ececf0;
    color: #747781;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 650
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 16px
}

.business-card {
    position: relative;
    display: block;
    min-height: 186px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: var(--shadow-xs);
    transition: transform .2s,box-shadow .2s,border-color .2s
}

    .business-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-sm);
        border-color: #d5d1ee
    }

    .business-card.core {
        border-color: #cfc7f2;
        box-shadow: 0 0 0 1px #eeeaff,0 9px 25px rgba(91,75,196,.07)
    }

.logo {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--purple-soft);
    color: var(--purple);
    display: grid;
    place-items: center;
    font-weight: 750;
    font-size: 11px;
    flex: none;
    object-fit: cover
}

    .logo.small {
        width: 36px;
        height: 36px;
        border-radius: 9px
    }

    .logo.tiny {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 9px
    }

    .logo.large {
        width: 60px;
        height: 60px;
        font-size: 16px
    }

.card-title {
    font-weight: 700;
    margin-top: 15px;
    font-size: 14px
}

.card-body p {
    font-size: 11px;
    line-height: 1.55;
    color: var(--muted);
    min-height: 39px;
    margin: 8px 0
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700
}

    .status.active {
        background: var(--green-soft);
        color: var(--green)
    }

    .status.inactive {
        background: #f0f1f3;
        color: #777b84
    }

    .status.core {
        background: var(--purple-soft);
        color: var(--purple)
    }

.service-count {
    position: absolute;
    right: 18px;
    bottom: 18px;
    color: #858892;
    font-size: 10px
}

/* Detail */
.detail-hero, .service-box, .table-card, .form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: var(--shadow-xs)
}

.detail-hero {
    padding: 24px;
    margin-bottom: 16px
}

.back {
    display: inline-flex;
    gap: 6px;
    font-size: 11px;
    color: #7d8088;
    margin-bottom: 20px
}

.hero-row {
    display: flex;
    gap: 16px;
    align-items: center
}

    .hero-row h1 {
        margin: 0 0 7px;
        font-family: "DM Sans",Inter,sans-serif;
        font-size: 26px
    }

    .hero-row p {
        color: var(--muted);
        font-size: 12px;
        max-width: 760px;
        margin: 0 0 10px;
        line-height: 1.55
    }

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    margin-bottom: 16px;
    overflow: hidden
}

    .detail-stats > div {
        padding: 17px 20px;
        border-right: 1px solid var(--line)
    }

        .detail-stats > div:last-child {
            border-right: 0
        }

    .detail-stats small {
        display: block;
        color: var(--muted);
        font-size: 9px;
        margin-bottom: 5px
    }

    .detail-stats strong {
        font-size: 13px
    }

.service-box {
    padding: 20px
}

.service-toolbar {
    justify-content: space-between;
    align-items: center
}

.chips, .tabs {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 0 11px;
    font-size: 10px;
    color: #666b74
}

    .chip:hover {
        background: #fafafe
    }

    .chip.selected {
        background: var(--purple-soft);
        border-color: #d9d2fa;
        color: var(--purple);
        font-weight: 650
    }

.service-row {
    display: flex;
    align-items: center;
    gap: 13px;
    border-top: 1px solid var(--line);
    padding: 15px 2px
}

.service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px
}

    .service-info strong {
        font-size: 12px
    }

    .service-info span {
        font-size: 10px;
        color: var(--muted)
    }

.tag {
    display: inline-flex;
    background: #f5f0e5;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    color: #75694f
}

.external {
    font-size: 17px;
    color: #777
}

.empty {
    padding: 42px;
    text-align: center;
    color: var(--muted);
    font-size: 12px
}

/* Tables */
.table-card {
    padding: 0;
    overflow: auto
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 12px;
    min-width: 760px
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle
}

th {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #8b8e97;
    background: #fafafd;
    font-weight: 750
}

tbody tr {
    transition: background .15s
}

    tbody tr:hover {
        background: #fcfcfe
    }

    tbody tr:last-child td {
        border-bottom: 0
    }

td small, .sort-row small, .user-cell small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.4
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--purple-soft);
    color: var(--purple);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 750;
    flex: none
}

.filter {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 10px;
    margin-bottom: 15px
}

.audit-filter {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 130px 130px auto;
    gap: 10px;
    margin-bottom: 15px;
    align-items: end
}

    .audit-filter label {
        margin-bottom: 4px
    }

/* Forms */
.form-card {
    width: min(920px,100%);
    margin: 0 auto;
    padding: 0;
    overflow: hidden
}

    .form-card > h1 {
        padding: 28px 30px 0;
        margin: 0;
        font-family: "DM Sans",Inter,sans-serif;
        font-size: 26px;
        letter-spacing: -.025em
    }

    .form-card > form {
        padding: 24px 30px 30px
    }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px
}

.fullcol {
    grid-column: 1/-1
}

.form-card textarea {
    min-height: 120px;
    resize: vertical
}

.field-help {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
    margin-top: 5px
}

.core-field {
    padding: 13px 14px;
    background: #faf9ff;
    border: 1px solid #e5e1fa;
    border-radius: 10px
}

    .core-field label {
        margin: 0
    }

    .core-field input {
        width: auto;
        margin-right: 6px
    }

.preview-logo {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fafafa
}

.form-intro {
    margin: -12px 0 20px
}

.form-section {
    padding-top: 24px;
    margin-top: 22px;
    border-top: 1px solid var(--line)
}

.form-section-title {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin-bottom: 14px
}

    .form-section-title > span {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        background: var(--purple-soft);
        color: var(--purple);
        display: grid;
        place-items: center;
        font-size: 9px;
        font-weight: 800
    }

    .form-section-title > div {
        display: flex;
        flex-direction: column
    }

    .form-section-title strong {
        font-size: 12px
    }

    .form-section-title small {
        font-size: 9px;
        color: var(--muted);
        margin-top: 3px
    }

.business-select-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px
}

.selection-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    transition: .18s
}

    .selection-card:hover {
        border-color: #cbc5ec;
        background: #fcfbff;
        transform: translateY(-1px)
    }

    .selection-card.selected {
        border-color: #bcb4eb;
        background: #f9f7ff;
        box-shadow: inset 0 0 0 1px #ddd8f8
    }

    .selection-card input, .visibility-card input, .role-option input, .user-selection input {
        position: absolute;
        opacity: 0;
        pointer-events: none
    }

.selection-check, .role-check, .user-check {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid #d8d6d0;
    border-radius: 5px;
    color: transparent;
    font-size: 10px;
    font-weight: 700;
    flex: none;
    transition: .18s
}

.selection-card.selected .selection-check, .role-option.selected .role-check, .user-selection.selected .user-check {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff
}

.selection-copy {
    display: flex;
    flex-direction: column;
    min-width: 0
}

    .selection-copy strong {
        font-size: 11px
    }

    .selection-copy small {
        font-size: 9px;
        color: #999;
        margin-top: 3px
    }

.visibility-options {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px
}

.visibility-card {
    position: relative;
    display: grid;
    grid-template-columns: 20px 36px 1fr;
    align-items: center;
    gap: 9px;
    padding: 15px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: .2s;
    min-height: 92px
}

    .visibility-card:hover {
        border-color: #c9c2eb;
        box-shadow: 0 7px 18px rgba(35,31,74,.05)
    }

    .visibility-card.selected {
        border-color: #b8afe9;
        background: #f8f6ff;
        box-shadow: inset 0 0 0 1px #ded9f7
    }

.radio-mark {
    width: 15px;
    height: 15px;
    border: 1.5px solid #c8c5be;
    border-radius: 50%;
    position: relative
}

.visibility-card.selected .radio-mark {
    border-color: var(--purple)
}

    .visibility-card.selected .radio-mark:after {
        content: "";
        position: absolute;
        inset: 3px;
        border-radius: 50%;
        background: var(--purple)
    }

.visibility-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0edff;
    color: var(--purple);
    display: grid;
    place-items: center;
    font-size: 15px
}

.visibility-copy {
    display: flex;
    flex-direction: column
}

    .visibility-copy strong {
        font-size: 11px
    }

    .visibility-copy small {
        font-size: 9px;
        line-height: 1.45;
        color: #8c8983;
        margin-top: 4px
    }

.visibility-detail {
    display: none;
    margin-top: 12px;
    border: 1px solid #e1def0;
    border-radius: 12px;
    background: #fbfaff;
    padding: 15px
}

    .visibility-detail.show {
        display: block;
        animation: panelIn .18s ease
    }

.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px
}

    .detail-head > div {
        display: flex;
        flex-direction: column
    }

    .detail-head strong {
        font-size: 11px
    }

    .detail-head small {
        font-size: 9px;
        color: #999;
        margin-top: 4px
    }

.detail-badge {
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .08em;
    color: #6b60b5;
    background: #efecff;
    padding: 5px 7px;
    border-radius: 999px
}

.role-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 10px;
    cursor: pointer;
    transition: .16s
}

    .role-option:hover {
        border-color: #c9c2eb
    }

    .role-option.selected {
        border-color: #b8afe9;
        background: #f0edff;
        color: #5748b8
    }

    .role-option .role-check {
        width: 16px;
        height: 16px;
        border-radius: 50%
    }

.user-select-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px
}

.user-selection {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: .16s
}

    .user-selection:hover {
        border-color: #c9c2eb
    }

    .user-selection.selected {
        border-color: #b8afe9;
        background: #f8f6ff
    }

    .user-selection .avatar {
        width: 30px;
        height: 30px;
        font-size: 9px
    }

    .user-selection > span:nth-of-type(2) {
        display: flex;
        flex-direction: column;
        min-width: 0
    }

        .user-selection > span:nth-of-type(2) strong {
            font-size: 10px
        }

        .user-selection > span:nth-of-type(2) small {
            font-size: 8px;
            color: #999;
            margin-top: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 210px
        }

.user-check {
    margin-left: auto;
    border-radius: 50%
}

.form-warning {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px solid #e9e3d3;
    background: #fffaf0;
    border-radius: 10px;
    color: #7c6a43
}

    .form-warning > span {
        font-size: 15px
    }

    .form-warning strong {
        font-size: 10px
    }

    .form-warning p {
        font-size: 9px;
        line-height: 1.5;
        margin: 4px 0 0;
        color: #8b7b5c
    }

.sticky-actions {
    margin: 0 -30px -30px;
    padding: 17px 30px;
    background: #fafafc;
    border-top: 1px solid var(--line)
}

/* Business ordering */
.sortable-list {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden
}

.sort-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--line);
    transition: .15s
}

    .sort-row:hover {
        background: #fcfcfe
    }

    .sort-row:last-child {
        border-bottom: 0
    }

.drag {
    cursor: grab;
    color: #a3a5ad;
    font-size: 15px
}

.grow {
    flex: 1
}

.order {
    font-size: 10px;
    color: #888
}

/* =========================================================
   KEIKEN LOGIN PAGE - SCOPED FINAL OVERRIDES
   These rules apply ONLY to .keiken-login-page.
   They do not change the Admin Console pages.
   ========================================================= */

body.keiken-login-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 48%, rgba(205, 150, 65, .13), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(92, 72, 190, .18), transparent 30%),
        radial-gradient(circle at 72% 88%, rgba(19, 74, 103, .13), transparent 32%),
        linear-gradient(135deg, #0b0b11 0%, #15131d 48%, #0c0c12 100%);
    color: #fff;
}

body.keiken-login-page .auth-layout {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: 50% 50%;
    overflow: hidden;
    isolation: isolate;
}

body.keiken-login-page .auth-layout::before {
    content: "";
    position: absolute;
    width: 720px;
    height: 720px;
    left: -300px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(214, 157, 67, .14) 0%,
        rgba(214, 157, 67, .035) 42%,
        transparent 72%
    );
    pointer-events: none;
    z-index: -1;
}

body.keiken-login-page .auth-layout::after {
    content: "";
    position: absolute;
    width: 680px;
    height: 680px;
    right: -300px;
    top: -240px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(105, 83, 214, .18) 0%,
        rgba(105, 83, 214, .045) 42%,
        transparent 72%
    );
    pointer-events: none;
    z-index: -1;
}

body.keiken-login-page .auth-brand-panel {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    text-align: center;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.018),
            rgba(255,255,255,.006) 50%,
            rgba(0,0,0,.10)
        );
}

body.keiken-login-page .auth-brand-panel::after {
    content: "";
    position: absolute;
    left: 13%;
    right: 13%;
    bottom: 17%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.09),
        transparent
    );
    pointer-events: none;
}

body.keiken-login-page .keiken-logo-large {
    width: 270px;
    height: 270px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.keiken-login-page .keiken-logo-large::before {
    content: "";
    position: absolute;
    inset: -45px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(213,157,67,.17) 0%,
            rgba(213,157,67,.055) 38%,
            transparent 70%
        );
    filter: blur(10px);
    pointer-events: none;
}

body.keiken-login-page .keiken-logo-image {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter:
        drop-shadow(0 22px 35px rgba(0,0,0,.60))
        drop-shadow(0 0 22px rgba(213,157,67,.12));
}

body.keiken-login-page .keiken-brand-text {
    position: relative;
    z-index: 2;
}

body.keiken-login-page .keiken-brand-text h1 {
    margin: 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .18em;
    text-shadow: 0 5px 20px rgba(0,0,0,.55);
}

body.keiken-login-page .keiken-brand-text p {
    margin: 12px 0 0;
    color: rgba(255,255,255,.58);
    font-family: Inter, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .12em;
}

body.keiken-login-page .auth-login-panel {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 70px;
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.018),
            rgba(255,255,255,.045)
        );
}

body.keiken-login-page .auth-login-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(255,255,255,.10),
        transparent
    );
}

body.keiken-login-page .auth-glass-card {
    width: min(520px, 100%);
    position: relative;
    overflow: hidden;
    padding: 48px 46px 34px;
    border-radius: 28px;

    /* glossy glass */
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.15) 0%,
            rgba(255,255,255,.075) 42%,
            rgba(255,255,255,.035) 100%
        );

    border: 1px solid rgba(255,255,255,.22);

    backdrop-filter: blur(30px) saturate(135%);
    -webkit-backdrop-filter: blur(30px) saturate(135%);

    box-shadow:
        0 40px 100px rgba(0,0,0,.55),
        0 12px 35px rgba(0,0,0,.28),
        inset 0 1px 0 rgba(255,255,255,.26),
        inset 0 -1px 0 rgba(255,255,255,.035);

    animation: authGlassIn .35s ease-out;
}

body.keiken-login-page .auth-glass-card::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.70),
        transparent
    );
    pointer-events: none;
}

body.keiken-login-page .auth-glass-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    top: -165px;
    right: -130px;
    border-radius: 50%;
    background: rgba(255,255,255,.055);
    filter: blur(4px);
    pointer-events: none;
}

body.keiken-login-page .auth-heading {
    margin: 0 0 31px;
    text-align: left;
    position: relative;
    z-index: 2;
}

body.keiken-login-page .auth-heading h1 {
    margin: 0;
    color: #fff;
    font-family: "DM Sans", Inter, Arial, sans-serif;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.035em;
    text-shadow: 0 2px 14px rgba(0,0,0,.20);
}

body.keiken-login-page .auth-heading p {
    margin: 10px 0 0;
    color: rgba(255,255,255,.60);
    font-size: 12px;
    line-height: 1.6;
}

body.keiken-login-page .auth-form {
    position: relative;
    z-index: 2;
    margin: 0;
}

body.keiken-login-page .auth-field {
    margin-bottom: 20px;
}

body.keiken-login-page .auth-field label {
    display: block;
    margin: 0 0 8px;
    color: rgba(255,255,255,.90);
    font-size: 12px;
    font-weight: 650;
}

body.keiken-login-page .auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

body.keiken-login-page .auth-input-icon {
    position: absolute;
    left: 14px;
    z-index: 2;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.52);
    pointer-events: none;
}

body.keiken-login-page .auth-input-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.keiken-login-page .auth-input-wrap .auth-input {
    width: 100%;
    height: 54px;
    padding: 0 46px 0 42px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 13px;
    background: rgba(255,255,255,.075);
    color: #fff;
    font-size: 12px;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 2px 4px rgba(0,0,0,.08);
    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

body.keiken-login-page .auth-input::placeholder {
    color: rgba(255,255,255,.42);
}

body.keiken-login-page .auth-input:hover {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.095);
}

body.keiken-login-page .auth-input:focus {
    border-color: rgba(165,151,255,.80);
    background: rgba(255,255,255,.11);
    box-shadow:
        0 0 0 4px rgba(105,83,214,.18),
        inset 0 1px 0 rgba(255,255,255,.07);
}

body.keiken-login-page .password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(255,255,255,.52);
    cursor: pointer;
    z-index: 3;
}

body.keiken-login-page .password-toggle:hover {
    background: rgba(255,255,255,.09);
    color: #fff;
}

body.keiken-login-page .validation-summary {
    color: #ffc2c8;
    background: rgba(179,61,72,.15);
    border-color: rgba(255,145,155,.32);
}

body.keiken-login-page .field-validation.field-validation-error {
    color: #ffb8bf;
}

body.keiken-login-page .auth-submit {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 54px;
    margin-top: 5px !important;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,.15);
    background: linear-gradient(135deg, #6b57d8, #5140bd);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow:
        0 16px 34px rgba(91,75,196,.36),
        inset 0 1px 0 rgba(255,255,255,.16);
}

body.keiken-login-page .auth-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 20px 42px rgba(91,75,196,.46),
        inset 0 1px 0 rgba(255,255,255,.18);
}

body.keiken-login-page .auth-security {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.11);
}

body.keiken-login-page .security-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.64);
}

body.keiken-login-page .auth-security strong {
    color: rgba(255,255,255,.84);
    font-size: 10px;
    font-weight: 650;
}

body.keiken-login-page .auth-security > div > span {
    color: rgba(255,255,255,.43);
    font-size: 9px;
}

body.keiken-login-page .auth-security > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Make the actual circular Keiken logo display correctly in the app sidebar. */
.brand-logo {
    width: 48px !important;
    height: 48px !important;
    display: block !important;
    flex: 0 0 48px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    background: #102132;
    box-shadow:
        0 5px 15px rgba(20,24,40,.10),
        inset 0 0 0 1px rgba(255,255,255,.10);
}

/* Login page only - responsive */
@media (max-width: 1000px) {
    body.keiken-login-page .auth-layout {
        grid-template-columns: 43% 57%;
    }

    body.keiken-login-page .auth-brand-panel {
        padding: 35px;
    }

    body.keiken-login-page .keiken-logo-large {
        width: 215px;
        height: 215px;
    }

    body.keiken-login-page .keiken-brand-text h1 {
        font-size: 36px;
    }

    body.keiken-login-page .auth-login-panel {
        padding: 40px;
    }

    body.keiken-login-page .auth-glass-card {
        padding: 40px 35px 30px;
    }
}

@media (max-width: 760px) {
    body.keiken-login-page .auth-layout {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    body.keiken-login-page .auth-brand-panel {
        min-height: 330px;
        padding: 40px 20px 30px;
    }

    body.keiken-login-page .auth-login-panel {
        min-height: auto;
        padding: 20px 18px 45px;
    }

    body.keiken-login-page .auth-login-panel::before {
        display: none;
    }

    body.keiken-login-page .keiken-logo-large {
        width: 155px;
        height: 155px;
        margin-bottom: 20px;
    }

    body.keiken-login-page .keiken-brand-text h1 {
        font-size: 30px;
    }

    body.keiken-login-page .keiken-brand-text p {
        font-size: 10px;
    }

    body.keiken-login-page .auth-glass-card {
        width: min(500px, 100%);
        padding: 34px 25px 27px;
        border-radius: 21px;
    }
}

@media (max-width: 430px) {
    body.keiken-login-page .auth-brand-panel {
        min-height: 285px;
    }

    body.keiken-login-page .keiken-logo-large {
        width: 125px;
        height: 125px;
        margin-bottom: 16px;
    }

    body.keiken-login-page .keiken-brand-text h1 {
        font-size: 27px;
    }

    body.keiken-login-page .auth-login-panel {
        padding: 15px 12px 30px;
    }

    body.keiken-login-page .auth-glass-card {
        padding: 29px 20px 23px;
        border-radius: 18px;
    }

    body.keiken-login-page .auth-heading h1 {
        font-size: 24px;
    }

    body.keiken-login-page .auth-heading p {
        font-size: 11px;
    }
}

/* Modal / toast */
.action-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(19,21,28,.42);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: .18s
}

    .action-modal.show {
        opacity: 1;
        visibility: visible
    }

.action-modal-card {
    position: relative;
    width: min(420px,100%);
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 28px 80px rgba(12,15,25,.25);
    text-align: center;
    transform: translateY(8px) scale(.98);
    transition: .18s
}

.action-modal.show .action-modal-card {
    transform: none
}

.modal-close {
    position: absolute;
    top: 11px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b8e97;
    font-size: 20px
}

    .modal-close:hover {
        background: #f4f4f6
    }

.modal-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 13px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--purple-soft);
    color: var(--purple);
    font-weight: 800;
    font-size: 19px
}

    .modal-icon.danger {
        background: var(--red-soft);
        color: var(--red)
    }

.action-modal-card h3 {
    margin: 0;
    font-family: "DM Sans",Inter,sans-serif;
    font-size: 20px
}

.action-modal-card p {
    margin: 8px auto 22px;
    max-width: 320px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 9px
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 210;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(380px,calc(100vw - 30px));
    pointer-events: none
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    font-size: 11px;
    color: #3f424a;
    transform: translateY(12px);
    opacity: 0;
    transition: .2s;
    pointer-events: auto
}

    .toast.show {
        transform: none;
        opacity: 1
    }

.toast-icon {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 800
}

.toast button {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #8b8e97;
    font-size: 16px
}

.mobile-backdrop {
    display: none
}

/* Desktop collapsed sidebar */
@media(min-width:901px) {
    body.sidebar-collapsed .sidebar {
        width: 78px
    }

    .sidebar-collapsed .main {
        width: calc(100% - 78px);
        margin-left: 78px
    }

    .sidebar-collapsed .brand {
        justify-content: center;
        padding-left: 0;
        padding-right: 0
    }

    .sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-label {
        display: none
    }

    .sidebar-collapsed .nav-item {
        justify-content: center
    }

        .sidebar-collapsed .nav-item.active:before {
            left: -8px
        }

    .sidebar-collapsed .nav-icon {
        width: auto
    }
}

@media(max-width:1100px) {
    :root {
        --sidebar: 225px
    }

    .content {
        padding-left: 30px;
        padding-right: 30px
    }

    .card-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .audit-filter {
        grid-template-columns: 1fr 1fr 1fr
    }
}

@media(max-width:900px) {
    :root {
        --topbar: 64px
    }

    .sidebar {
        width: 275px;
        transform: translateX(-100%);
        box-shadow: 18px 0 45px rgba(20,24,40,.16)
    }

        .sidebar.mobile-open {
            transform: none
        }

    .main {
        width: 100%;
        margin-left: 0
    }

    .topbar {
        padding: 0 18px
    }

    .mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(20,22,28,.36);
        opacity: 0;
        visibility: hidden;
        transition: .2s
    }

        .mobile-backdrop.show {
            opacity: 1;
            visibility: visible
        }

    .content {
        padding: 26px 22px 45px
    }

    .profile-copy {
        display: flex
    }

    .card-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .visibility-options {
        grid-template-columns: 1fr
    }

    .business-select-grid, .user-select-grid {
        grid-template-columns: 1fr
    }

    .audit-filter {
        grid-template-columns: 1fr 1fr
    }

    .form-card {
        width: 100%
    }
}

@media(max-width:620px) {
    .breadcrumb span, .breadcrumb i {
        display: none
    }

    .breadcrumb {
        font-size: 12px
    }

    .profile-copy, .profile-chevron {
        display: none
    }

    .profile-trigger {
        padding: 4px
    }

    .profile-avatar {
        width: 34px;
        height: 34px
    }

    .profile-menu {
        right: -5px;
        width: min(285px,calc(100vw - 24px))
    }

    .content {
        padding: 22px 15px 38px
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 22px
    }

        .page-head h1 {
            font-size: 26px
        }

        .page-head > .btn {
            width: 100%
        }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px
    }

    .business-card {
        min-height: 170px
    }

    .detail-stats {
        grid-template-columns: 1fr
    }

        .detail-stats > div {
            border-right: 0;
            border-bottom: 1px solid var(--line)
        }

            .detail-stats > div:last-child {
                border-bottom: 0
            }

    .hero-row {
        align-items: flex-start
    }

    .service-toolbar {
        align-items: flex-start;
        flex-direction: column
    }

        .service-toolbar .chips {
            width: 100%
        }

        .service-toolbar .chip {
            flex: 1;
            justify-content: center
        }

    .service-row {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .service-info {
        min-width: calc(100% - 58px)
    }

    .form-grid, .filter, .audit-filter {
        grid-template-columns: 1fr
    }

    .fullcol {
        grid-column: auto
    }

    .form-card > h1 {
        padding: 22px 19px 0;
        font-size: 23px
    }

    .form-card > form {
        padding: 20px 19px 19px
    }

    .sticky-actions {
        margin: 0 -19px -19px;
        padding: 14px 19px;
        position: sticky;
        bottom: 0;
        z-index: 5
    }

    .actions {
        flex-direction: column-reverse
    }

        .actions .btn {
            width: 100%
        }

    .visibility-card {
        grid-template-columns: 20px 34px 1fr;
        min-height: 84px
    }

    .table-card {
        border-radius: 12px
    }

    table {
        min-width: 700px
    }

    .toast-stack {
        right: 15px;
        bottom: 15px
    }

    .action-modal-card {
        padding: 25px 20px
    }

    .modal-actions {
        flex-direction: column-reverse
    }

        .modal-actions .btn {
            width: 100%
        }

    .brand {
        padding-left: 20px
    }
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(-3px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.form-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 27px 30px 22px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg,#fff,#fdfdff)
}

    .form-card-head h1 {
        margin: 3px 0 6px;
        font-family: "DM Sans",Inter,sans-serif;
        font-size: 26px;
        letter-spacing: -.025em
    }

    .form-card-head .back {
        margin-bottom: 5px
    }

.form-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--purple-soft);
    color: var(--purple);
    font-size: 17px;
    font-weight: 750;
    flex: none
}

.admin-form-card > form {
    padding-top: 25px
}

.first-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
    border-top: 0 !important
}

.url-field {
    display: flex;
    align-items: center;
    border: 1px solid #dfe1e7;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color .16s,box-shadow .16s
}

    .url-field:focus-within {
        border-color: #8d80dd;
        box-shadow: 0 0 0 4px rgba(91,75,196,.10)
    }

    .url-field > span {
        width: 40px;
        text-align: center;
        color: #8f87bd;
        font-size: 14px
    }

    .url-field input {
        border: 0;
        border-radius: 0;
        box-shadow: none
    }

        .url-field input:focus {
            box-shadow: none
        }

.security-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 12px 13px;
    border: 1px solid #e4e2eb;
    border-radius: 11px;
    background: #fbfbfe
}

.security-summary-icon {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--green-soft);
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    flex: none
}

.security-summary > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0
}

.security-summary strong {
    font-size: 10px
}

.security-summary small {
    font-size: 9px;
    color: var(--muted);
    line-height: 1.45;
    margin-top: 3px
}

.security-summary .status {
    margin-left: auto
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px;
    border: 1px dashed #d8d9e0;
    border-radius: 12px;
    background: #fcfcfd
}

.logo-upload-preview {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 13px;
    background: var(--purple-soft);
    color: var(--purple);
    font-weight: 750;
    font-size: 13px;
    overflow: hidden
}

    .logo-upload-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

.logo-upload > div:last-child {
    flex: 1
}

.logo-upload input[type=file] {
    padding: 9px;
    background: #fff
}
.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
/* =========================================================
   KEIKEN TWO-FACTOR AUTHENTICATION
   Scoped ONLY to the 2FA page.
   Does NOT affect Login or Admin Console pages.
   ========================================================= */

body.keiken-twofactor-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: radial-gradient( circle at 18% 45%, rgba(213, 157, 67, .12), transparent 30% ), radial-gradient( circle at 85% 15%, rgba(105, 83, 214, .18), transparent 32% ), radial-gradient( circle at 75% 90%, rgba(19, 74, 103, .12), transparent 32% ), linear-gradient( 135deg, #0a0a10 0%, #15131d 48%, #0b0b11 100% );
    color: #fff;
}


    /* -------------------------
   MAIN 2FA CONTAINER
   ------------------------- */

    body.keiken-twofactor-page .twofactor-page,
    body.keiken-twofactor-page .auth-twofactor,
    body.keiken-twofactor-page .two-factor-container {
        min-height: 100vh;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
    }


    /* -------------------------
   2FA CARD
   ------------------------- */

    body.keiken-twofactor-page .twofactor-card,
    body.keiken-twofactor-page .auth-card,
    body.keiken-twofactor-page .two-factor-card {
        width: min(470px, 100%);
        position: relative;
        padding: 42px 40px 32px;
        border-radius: 26px;
        background: linear-gradient( 145deg, rgba(255,255,255,.15), rgba(255,255,255,.075) 45%, rgba(255,255,255,.035) );
        border: 1px solid rgba(255,255,255,.22);
        backdrop-filter: blur(30px) saturate(135%);
        -webkit-backdrop-filter: blur(30px) saturate(135%);
        box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 15px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.04);
        overflow: hidden;
    }


        /* glossy top highlight */

        body.keiken-twofactor-page .twofactor-card::before,
        body.keiken-twofactor-page .auth-card::before,
        body.keiken-twofactor-page .two-factor-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 8%;
            right: 8%;
            height: 1px;
            background: linear-gradient( 90deg, transparent, rgba(255,255,255,.75), transparent );
        }


        /* subtle glass glow */

        body.keiken-twofactor-page .twofactor-card::after,
        body.keiken-twofactor-page .auth-card::after,
        body.keiken-twofactor-page .two-factor-card::after {
            content: "";
            position: absolute;
            width: 280px;
            height: 280px;
            top: -170px;
            right: -130px;
            border-radius: 50%;
            background: rgba(255,255,255,.06);
            filter: blur(10px);
            pointer-events: none;
        }


    /* -------------------------
   HEADER / BRAND
   ------------------------- */

    body.keiken-twofactor-page .twofactor-brand,
    body.keiken-twofactor-page .auth-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 34px;
    }

        body.keiken-twofactor-page .twofactor-brand img,
        body.keiken-twofactor-page .auth-brand img {
            width: 48px;
            height: 48px;
            object-fit: contain;
            border-radius: 50%;
        }


    /* -------------------------
   HEADING
   ------------------------- */

    body.keiken-twofactor-page h1,
    body.keiken-twofactor-page .twofactor-title,
    body.keiken-twofactor-page .auth-title {
        position: relative;
        z-index: 2;
        margin: 0 0 10px;
        color: #fff;
        font-family: "DM Sans", Inter, Arial, sans-serif;
        font-size: 28px;
        line-height: 1.2;
        font-weight: 700;
        letter-spacing: -.035em;
        text-shadow: 0 2px 14px rgba(0,0,0,.20);
    }


    body.keiken-twofactor-page p,
    body.keiken-twofactor-page .twofactor-description,
    body.keiken-twofactor-page .auth-description {
        position: relative;
        z-index: 2;
        margin: 0 0 28px;
        color: rgba(255,255,255,.62);
        font-size: 13px;
        line-height: 1.6;
    }


    /* -------------------------
   LABEL
   ------------------------- */

    body.keiken-twofactor-page label {
        display: block;
        margin-bottom: 8px;
        color: rgba(255,255,255,.90);
        font-size: 12px;
        font-weight: 650;
    }


    /* -------------------------
   INPUT
   ------------------------- */

    body.keiken-twofactor-page input[type="text"],
    body.keiken-twofactor-page input[type="number"],
    body.keiken-twofactor-page input[type="tel"],
    body.keiken-twofactor-page input[name*="Code"],
    body.keiken-twofactor-page input[id*="Code"] {
        width: 100%;
        height: 58px;
        padding: 0 18px;
        border: 1px solid rgba(255,255,255,.17);
        border-radius: 14px;
        background: rgba(255,255,255,.075);
        color: #fff;
        font-size: 20px;
        font-weight: 600;
        letter-spacing: .22em;
        text-align: center;
        outline: none;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 5px rgba(0,0,0,.08);
        transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }


    body.keiken-twofactor-page input:focus {
        border-color: rgba(165,151,255,.85);
        background: rgba(255,255,255,.11);
        box-shadow: 0 0 0 4px rgba(105,83,214,.18), inset 0 1px 0 rgba(255,255,255,.07);
    }


    body.keiken-twofactor-page input::placeholder {
        color: rgba(255,255,255,.35);
    }


    /* -------------------------
   VERIFY BUTTON
   ------------------------- */

    body.keiken-twofactor-page button[type="submit"],
    body.keiken-twofactor-page .btn.primary {
        width: 100%;
        min-height: 54px;
        margin-top: 20px;
        border: 1px solid rgba(255,255,255,.15);
        border-radius: 13px;
        background: linear-gradient( 135deg, #6b57d8, #5140bd );
        color: #fff;
        font-size: 13px;
        font-weight: 700;
        box-shadow: 0 16px 34px rgba(91,75,196,.36), inset 0 1px 0 rgba(255,255,255,.16);
        transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    }


        body.keiken-twofactor-page button[type="submit"]:hover,
        body.keiken-twofactor-page .btn.primary:hover {
            transform: translateY(-1px);
            filter: brightness(1.05);
            box-shadow: 0 20px 42px rgba(91,75,196,.46), inset 0 1px 0 rgba(255,255,255,.18);
        }


    /* -------------------------
   BACK TO LOGIN
   ------------------------- */

    body.keiken-twofactor-page a {
        color: rgba(255,255,255,.62);
        font-size: 12px;
        transition: color .18s ease;
    }


        body.keiken-twofactor-page a:hover {
            color: #fff;
        }


    /* Common back-link classes */

    body.keiken-twofactor-page .back-link,
    body.keiken-twofactor-page .auth-back,
    body.keiken-twofactor-page .twofactor-back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-top: 20px;
    }


    /* -------------------------
   VALIDATION
   ------------------------- */

    body.keiken-twofactor-page .field-validation,
    body.keiken-twofactor-page .validation-summary {
        color: #ffb8bf;
        font-size: 11px;
    }


    body.keiken-twofactor-page .validation-summary {
        margin-bottom: 15px;
    }


/* -------------------------  
   RESPONSIVE
   ------------------------- */

@media (max-width: 600px) {

    body.keiken-twofactor-page .twofactor-page,
    body.keiken-twofactor-page .auth-twofactor,
    body.keiken-twofactor-page .two-factor-container {
        padding: 25px 16px;
    }

    body.keiken-twofactor-page .twofactor-card,
    body.keiken-twofactor-page .auth-card,
    body.keiken-twofactor-page .two-factor-card {
        padding: 34px 24px 28px;
        border-radius: 21px;
    }

    body.keiken-twofactor-page h1,
    body.keiken-twofactor-page .twofactor-title,
    body.keiken-twofactor-page .auth-title {
        font-size: 24px;
    }
}


/* ============================================================
   KEIKEN AUTHENTICATION PAGES
   Final scoped styles.
   These selectors only apply to Login / MFA / MFA Setup.
   The existing admin console styles are intentionally untouched.
   ============================================================ */

body.keiken-login-page,
body.keiken-mfa-page,
body.keiken-setup-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #f5f6fa;
    color: #17181d;
    font-family: Inter, Arial, sans-serif;
}

body.keiken-login-page *,
body.keiken-mfa-page *,
body.keiken-setup-page * {
    box-sizing: border-box;
}

.keiken-auth-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 50% 50%;
}

/* ---------- LEFT BRAND PANEL ---------- */

.keiken-auth-brand {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 60px;
    background:
        radial-gradient(circle at 50% 35%, rgba(43,72,91,.20), transparent 30%),
        linear-gradient(145deg, #211e2c 0%, #1d1a27 52%, #181620 100%);
}

.keiken-auth-brand::before {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(218,151,61,.08), transparent 68%);
    pointer-events: none;
}

.keiken-auth-brand-inner {
    position: relative;
    z-index: 2;
    width: min(430px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.keiken-auth-logo {
    width: 280px;
    height: 280px;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 34px;
    box-shadow:
        0 28px 70px rgba(0,0,0,.38),
        0 0 0 1px rgba(255,255,255,.06);
}

.keiken-auth-brand-inner h1 {
    margin: 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 46px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .20em;
    text-indent: .20em;
    text-shadow: 0 5px 20px rgba(0,0,0,.25);
}

.keiken-auth-brand-inner p {
    margin: 14px 0 0;
    color: rgba(255,255,255,.62);
    font-size: 14px;
    letter-spacing: .08em;
}

/* ---------- RIGHT CONTENT ---------- */

.keiken-auth-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 70px;
    background:
        radial-gradient(circle at 90% 10%, rgba(105,83,214,.055), transparent 30%),
        #f5f6fa;
}

.keiken-auth-card {
    position: relative;
    width: min(490px, 100%);
    padding: 42px 44px 34px;
    border: 1px solid #e1e3ea;
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow:
        0 24px 70px rgba(26,29,40,.12),
        0 5px 18px rgba(26,29,40,.06);
}

.keiken-auth-heading {
    margin-bottom: 30px;
}

.keiken-auth-heading h2 {
    margin: 0;
    color: #15171c;
    font-family: "DM Sans", Inter, Arial, sans-serif;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.035em;
}

.keiken-auth-heading p {
    margin: 10px 0 0;
    color: #727784;
    font-size: 13px;
    line-height: 1.55;
}

.keiken-auth-form {
    width: 100%;
    margin: 0;
}

.keiken-form-field {
    width: 100%;
    margin-bottom: 20px;
}

.keiken-form-field label {
    display: block;
    margin: 0 0 8px;
    color: #252831;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
}

.keiken-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.keiken-input-icon {
    position: absolute;
    z-index: 2;
    left: 15px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #9196a3;
    pointer-events: none;
}

.keiken-input-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.keiken-input {
    width: 100%;
    height: 56px;
    min-width: 0;
    padding: 0 48px 0 43px;
    border: 1px solid #dfe2e8;
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: #191b21;
    font-family: Inter, Arial, sans-serif;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(16,24,40,.02);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.keiken-input::placeholder {
    color: #a0a5b1;
}

.keiken-input:hover {
    border-color: #cfd3dc;
}

.keiken-input:focus {
    border-color: #7663d7;
    box-shadow: 0 0 0 4px rgba(91,75,196,.10);
}

.keiken-password-toggle {
    position: absolute;
    z-index: 3;
    right: 6px;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #9196a3;
}

.keiken-password-toggle:hover {
    background: #f3f4f7;
    color: #5b4bc4;
}

.keiken-password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.keiken-eye-closed {
    display: none;
}

.keiken-password-toggle.is-showing .keiken-eye-open {
    display: none;
}

.keiken-password-toggle.is-showing .keiken-eye-closed {
    display: block;
}

.keiken-validation-summary {
    margin: 0 0 18px;
    padding: 11px 12px;
    border: 1px solid #f0c7cc;
    border-radius: 10px;
    background: #fff4f5;
    color: #a5323e;
    font-size: 12px;
    line-height: 1.45;
}

.keiken-field-error {
    display: block;
    min-height: 0;
    margin-top: 6px;
    color: #b33d48;
    font-size: 11px;
}

.keiken-auth-submit {
    position: relative;
    width: 100%;
    height: 56px;
    margin: 4px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #6552d0 0%, #5541c0 100%);
    color: #fff;
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(91,75,196,.23);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.keiken-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 16px 30px rgba(91,75,196,.29);
}

.keiken-auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.keiken-auth-submit:disabled {
    cursor: wait;
    opacity: .82;
}

.keiken-button-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: keikenAuthSpin .7s linear infinite;
}

.keiken-auth-submit.is-loading .keiken-button-text {
    visibility: hidden;
}

.keiken-auth-submit.is-loading .keiken-button-spinner {
    display: block;
}

.keiken-auth-security {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid #e8e9ee;
}

.keiken-security-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid #e2eee8;
    border-radius: 10px;
    background: #f3faf7;
    color: #4d9879;
}

.keiken-security-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.keiken-auth-security > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.keiken-auth-security strong {
    color: #454953;
    font-size: 11px;
    font-weight: 700;
}

.keiken-auth-security span:not(.keiken-security-icon) {
    color: #989ca6;
    font-size: 10px;
    line-height: 1.35;
}

/* ---------- MFA / SETUP ---------- */

.keiken-mfa-card,
.keiken-setup-card {
    width: min(510px, 100%);
}

.keiken-mfa-badge {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f1efff;
    color: #5b4bc4;
}

.keiken-mfa-badge svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.keiken-mfa-page .keiken-auth-heading,
.keiken-setup-page .keiken-auth-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.keiken-code-input {
    width: 100%;
    height: 58px;
    padding: 0 18px;
    border: 1px solid #dfe2e8;
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: #181a20;
    text-align: center;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .30em;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.keiken-code-input::placeholder {
    color: #a2a6b0;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
}

.keiken-code-input:focus {
    border-color: #7663d7;
    box-shadow: 0 0 0 4px rgba(91,75,196,.10);
}

.keiken-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 19px;
    color: #737783;
    font-size: 12px;
    font-weight: 500;
}

.keiken-auth-back:hover {
    color: #5b4bc4;
}

.keiken-qr {
    width: 202px;
    height: 202px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    padding: 11px;
    border: 1px solid #e4e5ea;
    border-radius: 15px;
    background: #fff;
}

.keiken-qr img,
.keiken-qr canvas {
    display: block;
    max-width: 180px;
    max-height: 180px;
}

.keiken-secret {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
    padding: 11px 13px;
    border: 1px solid #e4e5ea;
    border-radius: 10px;
    background: #fafafd;
}

.keiken-secret span {
    color: #777b86;
    font-size: 11px;
    font-weight: 600;
}

.keiken-secret code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4d41a9;
    font-size: 11px;
    font-family: Consolas, monospace;
    font-weight: 700;
}

/* ---------- AUTH MOBILE ---------- */

@media (max-width: 980px) {
    .keiken-auth-layout {
        grid-template-columns: 42% 58%;
    }

    .keiken-auth-brand {
        padding: 40px 25px;
    }

    .keiken-auth-logo {
        width: 210px;
        height: 210px;
    }

    .keiken-auth-brand-inner h1 {
        font-size: 38px;
    }

    .keiken-auth-content {
        padding: 40px 28px;
    }

    .keiken-auth-card {
        padding: 38px 34px 30px;
    }
}

@media (max-width: 760px) {
    .keiken-auth-layout {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .keiken-auth-brand {
        min-height: 330px;
        flex: none;
        padding: 38px 20px 30px;
    }

    .keiken-auth-logo {
        width: 155px;
        height: 155px;
        margin-bottom: 22px;
    }

    .keiken-auth-brand-inner h1 {
        font-size: 31px;
    }

    .keiken-auth-brand-inner p {
        margin-top: 10px;
        font-size: 11px;
    }

    .keiken-auth-content {
        min-height: auto;
        flex: 1;
        padding: 22px 16px 45px;
    }

    .keiken-auth-card {
        width: min(520px, 100%);
        padding: 31px 24px 26px;
        border-radius: 19px;
    }

    .keiken-auth-heading h2 {
        font-size: 25px;
    }
}

@media (max-width: 430px) {
    .keiken-auth-brand {
        min-height: 285px;
    }

    .keiken-auth-logo {
        width: 125px;
        height: 125px;
        margin-bottom: 17px;
    }

    .keiken-auth-brand-inner h1 {
        font-size: 27px;
    }

    .keiken-auth-content {
        padding: 15px 12px 30px;
    }

    .keiken-auth-card {
        padding: 27px 19px 23px;
    }

    .keiken-auth-heading h2 {
        font-size: 23px;
    }

    .keiken-auth-heading p {
        font-size: 12px;
    }

    .keiken-secret {
        align-items: flex-start;
        flex-direction: column;
    }
}

@keyframes keikenAuthSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   ADMIN CONSOLE LOGO
   Explicitly scoped to the existing shell so the circular logo
   is used without changing sidebar sizing/layout.
   ============================================================ */

.shell .brand .brand-logo {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    display: block !important;
    flex: 0 0 48px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
    background: #102132 !important;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(20,24,40,.10);
}

.shell .brand {
    flex-shrink: 0;
}
