:root {
    --grey-900: #444250;
    --grey-500: #a0a1a2;
    --grey-100: #f4f5f6;
    --grey-050: #fafafa;
    --white: #ffffff;
    --construction: #f67220;
    --windows: #3a99dc;
    --finishes: #88104a;
    --green: #168a4a;
    --amber: #c97912;
    --red: #c0362c;
    --line: #e3e5e7;
    --shadow: 0rem 0.3125rem 0.3125rem 0rem rgba(82, 63, 105, 0.05), 0 18px 44px rgba(68, 66, 80, 0.08);
    --radius: 8px;
    --font-ui: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: "Poppins", "Roboto", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--grey-100);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--grey-900);
    background: var(--grey-100);
    font-family: var(--font-ui);
    font-size: 15px;
    letter-spacing: 0;
}

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

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

img {
    max-width: 100%;
}

.auth-shell,
.public-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel,
.public-panel,
.mobile-panel {
    width: min(100%, 440px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.logo {
    display: block;
    width: 168px;
    height: auto;
}

.logo-small {
    width: 132px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--line);
    padding: 22px 18px;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
    margin-top: 28px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #595763;
    font-size: 14px;
    font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
    background: var(--grey-100);
    color: var(--grey-900);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--grey-500);
}

.main {
    min-width: 0;
    padding: 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 auto;
    width: min(100%, 520px);
}

.page-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: 0;
}

.section-title {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.2;
}

.muted {
    color: #74717c;
}

.small {
    font-size: 12px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.card,
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.card {
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-body {
    padding: 18px;
}

.stat {
    display: grid;
    gap: 8px;
    min-height: 104px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: #74717c;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.row-title {
    font-weight: 800;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: currentColor;
}

.status.green {
    color: var(--green);
    background: rgba(22, 138, 74, 0.1);
}

.status.amber {
    color: var(--amber);
    background: rgba(201, 121, 18, 0.12);
}

.status.red {
    color: var(--red);
    background: rgba(192, 54, 44, 0.11);
}

.status.neutral {
    color: #6f6c78;
    background: var(--grey-100);
}

.division-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--grey-100);
    font-size: 12px;
    font-weight: 750;
}

.division-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: var(--division-colour, var(--grey-500));
}

.btn,
.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--grey-900);
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
}

.btn.secondary,
.link-btn.secondary {
    background: var(--white);
    color: var(--grey-900);
    border-color: var(--line);
}

.btn.warning {
    background: var(--construction);
}

.btn.danger {
    background: var(--red);
}

.btn.full {
    width: 100%;
}

.form-grid {
    display: grid;
    gap: 14px;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field label,
.label {
    color: #5f5c68;
    font-size: 13px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--grey-900);
}

.field textarea {
    min-height: 92px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.check-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font-weight: 750;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--grey-100);
    border: 1px solid var(--line);
}

.avatar.large {
    width: 86px;
    height: 86px;
}

.passport-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.document-list {
    display: grid;
    gap: 10px;
}

.document-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.mobile-app {
    min-height: 100vh;
    background: var(--grey-100);
    padding-bottom: 84px;
}

.mobile-content {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 18px 14px 24px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    transform: translateX(-50%);
    width: min(100%, 520px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--white);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(68, 66, 80, 0.08);
}

.bottom-nav a {
    min-height: 62px;
    display: grid;
    place-items: center;
    color: #74717c;
    font-size: 12px;
    font-weight: 800;
}

.bottom-nav a.active {
    color: var(--grey-900);
}

.qr-card {
    display: grid;
    gap: 16px;
    justify-items: center;
    text-align: center;
}

.qr-box {
    width: min(76vw, 380px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.qr-box svg {
    width: 100%;
    height: 100%;
}

.share-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    min-width: 190px;
    border-radius: var(--radius);
    background: var(--grey-900);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 4px;
}

.notice {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: rgba(58, 153, 220, 0.11);
    border: 1px solid rgba(58, 153, 220, 0.28);
}

.error {
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(31, 30, 38, 0.7);
}

.lightbox:target {
    display: grid;
}

.lightbox-inner {
    width: min(100%, 860px);
    height: min(90vh, 760px);
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.lightbox-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.lightbox-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--grey-100);
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .main {
        padding: 18px 14px 88px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

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

    th,
    td {
        padding: 11px 10px;
    }
}

/* Mophy / Exact Group integration */
body.eg-admin-shell,
body.eg-public-shell {
    --bs-primary: #f67220;
    --bs-primary-rgb: 246, 114, 32;
    --bs-secondary: #444250;
    --bs-secondary-rgb: 68, 66, 80;
    --bs-success: #168a4a;
    --bs-success-rgb: 22, 138, 74;
    --bs-warning: #c97912;
    --bs-warning-rgb: 201, 121, 18;
    --bs-danger: #c0362c;
    --bs-danger-rgb: 192, 54, 44;
    --bs-info: #3a99dc;
    --bs-info-rgb: 58, 153, 220;
    --bs-heading-color: #444250;
    --bs-body-font-family: var(--font-ui);
    --bs-border-radius: 8px;
    --bs-border-radius-lg: 12px;
    --bs-body-bg: #f4f5f9;
    --bs-body-color: #74717c;
    background: var(--bs-body-bg);
    font-family: var(--font-ui);
}

body.eg-admin-shell[data-bs-theme="dark"],
body.eg-admin-shell[data-theme-version="dark"] {
    --bs-body-bg: #211f25;
    --bs-body-color: #c7c3cb;
    --bs-heading-color: #ffffff;
    --bs-border-color: #45414c;
    --white: #2b2930;
    --grey-100: #211f25;
    --grey-050: #302d35;
    --line: #45414c;
    --grey-900: #ffffff;
    --grey-500: #9ea8ba;
    color: var(--bs-body-color);
}

.eg-ready body,
.eg-ready .content-body,
.eg-ready .mobile-content,
.eg-ready .auth-panel,
.eg-ready .public-panel {
    animation: egPageIn 280ms ease both;
}

@keyframes egPageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eg-mophy-wrapper .nav-header {
    background: var(--white);
    border-right: 1px solid var(--line);
    box-shadow: none;
    height: 6rem;
}

.eg-mophy-wrapper .brand-logo.eg-brand {
    justify-content: center;
    padding: 0 18px;
}

.eg-brand-logo {
    width: 172px;
    max-height: 74px;
    object-fit: contain;
}

.eg-mophy-wrapper .header {
    min-height: 6rem;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 34px rgba(68, 66, 80, 0.06);
}

body[data-bs-theme="dark"] .eg-mophy-wrapper .header {
    background: rgba(43, 41, 48, 0.94);
}

body[data-bs-theme="dark"] .eg-mophy-wrapper .nav-header {
    background: #ffffff;
}

.eg-admin-title {
    margin: 0;
    color: var(--bs-heading-color);
    font-family: var(--font-heading);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
}

.eg-admin-subtitle {
    color: var(--grey-500);
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.eg-theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(246, 114, 32, 0.1);
    color: var(--construction);
}

.eg-profile-menu {
    gap: 12px;
}

.eg-profile-menu .header-info span {
    color: var(--bs-heading-color);
    display: block;
    font-size: 14px;
    line-height: 1.1;
}

.eg-profile-menu .header-info p {
    color: var(--grey-500);
    font-size: 12px;
    margin: 4px 0 0;
}

.eg-profile-avatar,
.eg-avatar-sm {
    align-items: center;
    background: var(--grey-900);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-family: var(--font-heading);
    font-weight: 700;
    justify-content: center;
}

.eg-profile-avatar {
    height: 42px;
    width: 42px;
}

.eg-avatar-sm {
    flex: 0 0 40px;
    height: 40px;
    width: 40px;
}

.eg-deznav {
    background: var(--white);
    border-right: 1px solid var(--line);
    padding-top: 14px;
}

.eg-deznav .metismenu > li > a {
    border-radius: 8px;
    color: #5f5c68;
    font-weight: 600;
    margin: 2px 14px;
    min-height: 46px;
    padding: 11px 16px;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.eg-deznav .metismenu > li > a:hover,
.eg-deznav .metismenu > li.mm-active > a {
    background: rgba(246, 114, 32, 0.1);
    color: var(--construction);
    transform: translateX(2px);
}

.eg-deznav .metismenu > li > a i {
    color: currentColor;
    font-size: 20px;
    min-width: 24px;
}

.eg-deznav-footer {
    padding: 18px;
}

.eg-clearance-card {
    background: var(--grey-050);
    border: 1px solid rgba(246, 114, 32, 0.16);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.eg-clearance-card span,
.eg-clearance-card small {
    color: #74717c;
    font-size: 12px;
}

.eg-clearance-card strong {
    color: var(--bs-heading-color);
    font-size: 13px;
}

.content-body .container-fluid {
    padding-top: 28px;
}

.eg-dashboard .card,
.eg-panel,
.card,
.panel,
.auth-panel,
.public-panel,
.mobile-panel {
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.eg-panel .card-header,
.card-header,
.panel-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: 20px 22px;
}

.eg-panel .card-body,
.panel-body {
    padding: 22px;
}

.card-title,
.section-title,
.page-title {
    color: var(--bs-heading-color);
    font-family: var(--font-heading);
    letter-spacing: 0;
}

.eg-muted,
.muted {
    color: #858391;
}

.eg-stat-card {
    min-height: 156px;
    overflow: hidden;
    position: relative;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.eg-stat-card:hover {
    box-shadow: 0 20px 44px rgba(68, 66, 80, 0.13);
    transform: translateY(-3px);
}

.eg-stat-card-primary {
    background: #444250;
}

.eg-stat-card-primary .eg-stat-label,
.eg-stat-card-primary .eg-stat-note,
.eg-stat-card-primary .eg-stat-value {
    color: #fff;
}

.eg-stat-card .card-body {
    display: grid;
    gap: 8px;
    padding: 22px;
}

.eg-stat-icon {
    align-items: center;
    background: rgba(246, 114, 32, 0.13);
    border-radius: 8px;
    color: var(--construction);
    display: inline-flex;
    font-size: 26px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.eg-stat-green {
    background: rgba(22, 138, 74, 0.12);
    color: var(--green);
}

.eg-stat-orange {
    background: rgba(246, 114, 32, 0.13);
    color: var(--construction);
}

.eg-stat-red {
    background: rgba(192, 54, 44, 0.12);
    color: var(--red);
}

.eg-stat-label {
    color: #858391;
    font-size: 13px;
    font-weight: 700;
}

.eg-stat-value {
    color: var(--bs-heading-color);
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
}

.eg-stat-note {
    color: #858391;
    font-size: 13px;
}

.eg-chart {
    min-height: 310px;
}

.eg-chart-sm,
.eg-donut {
    min-height: 260px;
}

.eg-clearance-note {
    background: var(--grey-100);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.eg-clearance-note strong {
    color: var(--bs-heading-color);
}

.eg-clearance-note span {
    color: #74717c;
    font-size: 13px;
}

.eg-table {
    color: var(--bs-body-color);
}

.eg-table thead th {
    background: var(--grey-050);
    border-bottom: 1px solid var(--line);
    color: #74717c;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.eg-table tbody td {
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.eg-table td span:not(.status):not(.division-tag) {
    color: #858391;
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.eg-table-title {
    color: var(--bs-heading-color);
    display: inline-block;
    font-weight: 700;
}

.eg-action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eg-inline-reject {
    display: none;
    gap: 8px;
    grid-template-columns: minmax(150px, 1fr) auto;
    margin-top: 8px;
}

.eg-inline-reject.is-open {
    display: grid;
}

.eg-risk-list,
.eg-invite-list,
.eg-scan-list,
.eg-form-stack {
    display: grid;
    gap: 12px;
}

.eg-risk-item,
.eg-invite-item,
.eg-scan-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: inherit;
    display: flex;
    gap: 12px;
    padding: 12px;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.eg-risk-item:hover,
.eg-invite-item:hover,
.eg-scan-item:hover {
    background: rgba(246, 114, 32, 0.04);
    border-color: rgba(246, 114, 32, 0.28);
    transform: translateY(-1px);
}

.eg-risk-item span:nth-child(2),
.eg-invite-item > div,
.eg-scan-item span:nth-child(2) {
    display: grid;
    flex: 1;
    min-width: 0;
}

.eg-risk-item strong,
.eg-invite-item strong,
.eg-scan-item strong {
    color: var(--bs-heading-color);
}

.eg-risk-item small,
.eg-invite-item span,
.eg-invite-item small,
.eg-scan-item small {
    color: #858391;
    font-size: 12px;
}

.eg-scan-item > i {
    align-items: center;
    background: rgba(58, 153, 220, 0.12);
    border-radius: 8px;
    color: var(--windows);
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 22px;
    height: 40px;
    justify-content: center;
}

.eg-empty {
    color: #858391;
    padding: 14px;
}

.eg-tabs {
    background: var(--grey-100);
    border-radius: 8px;
    padding: 4px;
}

.eg-tabs .nav-link {
    border-radius: 6px;
    color: #74717c;
    font-weight: 700;
}

.eg-tabs .nav-link.active {
    background: var(--white);
    box-shadow: 0 6px 18px rgba(68, 66, 80, 0.08);
    color: var(--bs-heading-color);
}

.btn,
.link-btn {
    border-radius: 8px;
    box-shadow: 0 7px 16px rgba(68, 66, 80, 0.08);
    font-family: var(--font-ui);
    font-weight: 700;
    letter-spacing: 0;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn:hover,
.link-btn:hover {
    transform: translateY(-1px);
}

.eg-admin-shell .btn.btn-primary,
.btn:not(.secondary):not(.btn-light):not(.btn-outline-primary):not(.btn-outline-danger):not(.btn-success):not(.btn-danger):not(.btn-warning),
.link-btn:not(.secondary) {
    background: var(--construction);
    border-color: var(--construction);
    color: #fff;
}

.eg-admin-shell .btn.btn-primary.light,
.eg-admin-shell .btn.btn-outline-primary,
.link-btn.secondary,
.btn.secondary {
    background: rgba(246, 114, 32, 0.09);
    border-color: rgba(246, 114, 32, 0.2);
    color: var(--construction);
}

.eg-admin-shell .btn.btn-light,
.btn.btn-light {
    background: var(--grey-100);
    border-color: var(--line);
    color: var(--bs-heading-color);
}

.btn.btn-success {
    background: var(--green);
    border-color: var(--green);
}

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

.field input,
.field select,
.field textarea,
.form-control {
    border-radius: 10px;
    box-shadow: none;
    min-height: 44px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus {
    border-color: rgba(246, 114, 32, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(246, 114, 32, 0.12);
    outline: 0;
}

.check-card,
.eg-toggle-card {
    border-radius: 8px;
    box-shadow: none;
    font-size: 13px;
    min-height: 38px;
    padding: 8px 10px;
}

input[type="checkbox"] {
    accent-color: var(--construction);
}

.eg-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eg-check-chip {
    cursor: pointer;
}

.eg-check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.eg-check-chip span {
    align-items: center;
    background: var(--grey-100);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--bs-heading-color);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 7px;
    min-height: 34px;
    padding: 7px 11px;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.eg-check-chip span::before {
    background: var(--chip-colour, var(--construction));
    border-radius: 50%;
    content: "";
    height: 8px;
    width: 8px;
}

.eg-check-chip input:checked + span {
    background: color-mix(in srgb, var(--chip-colour, var(--construction)) 12%, transparent);
    border-color: color-mix(in srgb, var(--chip-colour, var(--construction)) 42%, var(--line));
}

.eg-check-chip:hover span {
    transform: translateY(-1px);
}

.status {
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0;
    min-height: 26px;
}

.division-tag {
    border-radius: 999px;
}

.notice {
    background: rgba(58, 153, 220, 0.1);
    border: 1px solid rgba(58, 153, 220, 0.24);
    box-shadow: 0 10px 22px rgba(58, 153, 220, 0.08);
}

.eg-file-link {
    min-height: 36px;
    padding: 8px 11px;
}

.lightbox.eg-lightbox {
    align-items: center;
    background: rgba(19, 21, 31, 0.64);
    backdrop-filter: blur(7px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.lightbox.eg-lightbox:target {
    display: grid;
    opacity: 1;
    pointer-events: auto;
}

.eg-lightbox-backdrop {
    inset: 0;
    position: absolute;
}

.eg-lightbox-inner {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    max-height: 88vh;
    position: relative;
    transform: translateY(10px) scale(0.98);
    transition: transform 200ms ease;
    z-index: 1;
}

.lightbox.eg-lightbox:target .eg-lightbox-inner {
    transform: translateY(0) scale(1);
}

.lightbox-head {
    background: var(--white);
}

.lightbox-frame {
    background: var(--grey-100);
}

.auth-shell,
.public-shell {
    background: var(--grey-100);
}

.auth-panel,
.public-panel {
    border: 0;
    border-radius: 8px;
}

.mobile-app {
    background: var(--grey-100);
}

.mobile-topbar {
    box-shadow: 0 8px 24px rgba(68, 66, 80, 0.08);
}

.bottom-nav {
    border-radius: 18px 18px 0 0;
}

.bottom-nav a {
    gap: 2px;
    line-height: 1;
}

.bottom-nav i {
    display: block;
    font-size: 22px;
}

.bottom-nav span {
    display: block;
    font-size: 11px;
}

.qr-box {
    width: min(82vw, 420px);
}

/* Application-specific Mophy components */
.eg-admin-shell .card {
    padding: 0;
}

.eg-nav-control {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.eg-theme-toggle {
    align-items: center;
    border: 0;
    display: inline-flex;
    justify-content: center;
}

.eg-theme-toggle #icon-light {
    display: none;
}

body[data-bs-theme="dark"] .eg-theme-toggle #icon-light {
    display: inline-block;
}

body[data-bs-theme="dark"] .eg-theme-toggle #icon-dark {
    display: none;
}

.eg-admin-shell .dropdown-item {
    align-items: center;
    display: flex;
    gap: 8px;
}

.eg-admin-shell .dropdown-item i {
    font-size: 19px;
}

.eg-card-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.eg-filter-bar {
    align-items: end;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, 280px) auto;
}

.eg-filter-search {
    min-width: 0;
}

.eg-filter-bar-single {
    grid-template-columns: minmax(240px, 520px) auto;
    justify-content: start;
}

.eg-input-icon {
    position: relative;
}

.eg-input-icon > i {
    color: #858391;
    font-size: 19px;
    left: 13px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.eg-input-icon .form-control {
    padding-left: 40px;
}

.eg-filter-actions,
.eg-tag-list,
.eg-file-actions,
.eg-document-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eg-filter-actions {
    min-height: 44px;
}

.eg-icon-button {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    padding: 0;
    width: 38px;
}

.eg-icon-button i {
    font-size: 19px;
}

.eg-admin-shell .btn-sm {
    min-height: 34px;
    padding: 6px 10px;
}

.eg-pagination {
    border-top: 1px solid var(--line);
}

.eg-pagination nav > div:first-child {
    display: none;
}

.eg-pagination nav > div:last-child {
    align-items: center;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.eg-pagination svg {
    height: 18px;
    width: 18px;
}

.eg-profile-card .card-body {
    padding: 24px;
}

.eg-avatar-placeholder {
    align-items: center;
    display: inline-flex;
    font-size: 34px;
    justify-content: center;
}

.eg-eyebrow {
    color: #858391;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.eg-detail-list {
    display: grid;
    margin-bottom: 0;
}

.eg-detail-list > div {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 10px 0;
}

.eg-detail-list dt {
    color: #858391;
    font-size: 12px;
    font-weight: 700;
}

.eg-detail-list dd {
    color: var(--bs-heading-color);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    overflow-wrap: anywhere;
}

.eg-attention-list {
    background: rgba(192, 54, 44, 0.07);
    border: 1px solid rgba(192, 54, 44, 0.16);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    padding: 13px;
}

.eg-attention-list strong {
    color: var(--red);
}

.eg-attention-list span {
    align-items: center;
    color: var(--bs-body-color);
    display: flex;
    font-size: 12px;
    gap: 7px;
}

.eg-disclosure {
    overflow: hidden;
}

.eg-disclosure > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    list-style: none;
}

.eg-disclosure > summary::-webkit-details-marker,
.eg-rule-item > summary::-webkit-details-marker {
    display: none;
}

.eg-disclosure > summary span {
    align-items: center;
    display: flex;
    gap: 9px;
}

.eg-disclosure-arrow {
    transition: transform 180ms ease;
}

details[open] > summary .eg-disclosure-arrow {
    transform: rotate(180deg);
}

.eg-document-list {
    display: grid;
    gap: 14px;
}

.eg-document-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 18px;
}

.eg-document-main,
.eg-document-heading > div {
    min-width: 0;
}

.eg-document-heading {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.eg-document-heading h3 {
    color: var(--bs-heading-color);
    font-family: var(--font-heading);
    font-size: 16px;
    margin: 0 0 3px;
}

.eg-document-heading > div > span,
.eg-document-notes {
    color: #858391;
    font-size: 12px;
}

.eg-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.eg-document-meta span {
    color: var(--bs-heading-color);
    display: grid;
    font-size: 12px;
    gap: 2px;
}

.eg-document-meta strong {
    color: #858391;
    font-size: 10px;
    text-transform: uppercase;
}

.eg-document-notes {
    margin: 12px 0 0;
}

.eg-rejection {
    align-items: center;
    color: var(--red);
    display: flex;
    font-size: 12px;
    gap: 6px;
    margin-top: 10px;
}

.eg-file-actions {
    margin-top: 12px;
}

.eg-file-link {
    border: 1px solid var(--line);
    box-shadow: none;
    min-height: 34px;
    max-width: 100%;
}

.eg-file-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eg-document-actions {
    align-content: flex-start;
    align-items: flex-end;
    flex-direction: column;
    max-width: 260px;
}

.eg-document-actions .eg-inline-reject {
    width: 260px;
}

.eg-rule-list {
    border-top: 1px solid var(--line);
}

.eg-rule-search {
    max-width: 280px;
    width: 100%;
}

.eg-rule-item {
    border-bottom: 1px solid var(--line);
}

.eg-rule-item > summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    list-style: none;
    padding: 16px 22px;
}

.eg-rule-item[open] > summary {
    background: var(--grey-050);
}

.eg-rule-icon {
    align-items: center;
    background: rgba(246, 114, 32, 0.1);
    border-radius: 8px;
    color: var(--construction);
    display: inline-flex;
    font-size: 22px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.eg-rule-summary {
    display: grid;
    min-width: 0;
}

.eg-rule-summary strong {
    color: var(--bs-heading-color);
}

.eg-rule-summary small {
    color: #858391;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eg-rule-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.eg-rule-form {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.eg-fieldset {
    border: 0;
    display: grid;
    gap: 9px;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.eg-fieldset legend {
    color: #5f5c68;
    font-size: 13px;
    font-weight: 800;
    margin: 0;
}

.eg-option-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eg-option-grid .check-card {
    margin: 0;
    width: 100%;
}

.eg-sticky-panel {
    position: sticky;
    top: 7.5rem;
}

.eg-admin-edit-row {
    display: none;
}

.eg-admin-edit-row.is-open {
    display: table-row;
}

.eg-admin-edit-row > td {
    background: var(--grey-050);
    padding: 20px 22px;
}

.eg-admin-editor {
    align-items: end;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.eg-flash {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.eg-flash > i {
    flex: 0 0 auto;
    font-size: 21px;
    margin-top: 1px;
}

.eg-flash > span,
.eg-flash > div {
    min-width: 0;
}

.eg-flash-error {
    background: rgba(192, 54, 44, 0.08);
    border-color: rgba(192, 54, 44, 0.25);
    color: var(--red);
}

.eg-flash-error ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.eg-copy-field {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 8px 0 5px;
}

.eg-copy-field .form-control {
    min-width: 0;
}

.eg-copy-field .is-copied {
    background: rgba(22, 138, 74, 0.12);
    color: var(--green);
}

.eg-active-code {
    align-items: center;
    display: flex;
    gap: 10px;
}

.eg-active-code i {
    font-size: 22px;
}

.eg-mobile-title {
    font-size: 30px;
}

body.eg-modal-open {
    overflow: hidden;
}

.lightbox.eg-lightbox.is-open {
    display: grid;
    opacity: 1;
    pointer-events: auto;
}

.lightbox.eg-lightbox.is-open .eg-lightbox-inner {
    transform: translateY(0) scale(1);
}

.eg-lightbox-backdrop {
    background: transparent;
    border: 0;
    cursor: default;
}

body[data-bs-theme="dark"] .eg-document-item,
body[data-bs-theme="dark"] .eg-attention-list,
body[data-bs-theme="dark"] .eg-rule-item[open] > summary,
body[data-bs-theme="dark"] .eg-clearance-note,
body[data-bs-theme="dark"] .eg-tabs,
body[data-bs-theme="dark"] .eg-check-chip span,
body[data-bs-theme="dark"] .check-card,
body[data-bs-theme="dark"] .field input,
body[data-bs-theme="dark"] .field select,
body[data-bs-theme="dark"] .field textarea,
body[data-bs-theme="dark"] .form-control {
    background: var(--white);
    border-color: var(--line);
    color: var(--bs-heading-color);
}

@media (max-width: 980px) {
    .eg-admin-title {
        font-size: 21px;
    }

    .eg-profile-menu .header-info {
        display: none;
    }

    .eg-filter-bar {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    }

    .eg-filter-actions {
        grid-column: 1 / -1;
    }

    .eg-sticky-panel {
        position: static;
    }

    .eg-document-item {
        grid-template-columns: 1fr;
    }

    .eg-document-actions {
        align-items: center;
        flex-direction: row;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .page-title,
    .eg-mobile-title {
        font-size: 28px;
    }

    .eg-admin-shell .content-body .container-fluid {
        padding: 16px 10px 28px;
    }

    .eg-admin-shell .card-header,
    .eg-admin-shell .card-body,
    .eg-panel .card-header,
    .eg-panel .card-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .eg-admin-subtitle {
        display: none;
    }

    .eg-theme-toggle {
        height: 38px;
        width: 38px;
    }

    .eg-profile-avatar {
        height: 38px;
        width: 38px;
    }

    .eg-filter-bar {
        grid-template-columns: 1fr;
    }

    .eg-filter-actions {
        grid-column: auto;
    }

    .eg-rule-item > summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 14px 16px;
    }

    .eg-rule-badges {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .eg-rule-form {
        padding: 18px 16px;
    }

    .eg-option-grid {
        grid-template-columns: 1fr;
    }

    .eg-admin-editor {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .eg-document-item {
        padding: 14px;
    }

    .eg-document-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .eg-document-actions,
    .eg-document-actions .eg-inline-reject {
        width: 100%;
    }

    .eg-document-actions .eg-inline-reject {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .auth-shell,
    .public-shell {
        padding: 10px;
    }

    .mobile-content {
        margin: 0;
        padding: 0 0 88px;
        width: 100%;
    }

    .mobile-content > .grid,
    .mobile-content > form.grid {
        gap: 12px;
    }

    .mobile-content .card,
    .mobile-content .panel,
    .mobile-content .notice {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        box-shadow: none;
    }

    .mobile-content .panel-body,
    .mobile-content .card {
        padding: 18px 16px;
    }

    .document-row {
        grid-template-columns: 1fr;
    }

    .document-row > .status,
    .document-row > div[style*="justify-items:end"] {
        justify-self: start;
    }

    .qr-box {
        width: min(92vw, 430px);
        padding: 14px;
    }

    .eg-lightbox-inner {
        border-radius: 8px;
        height: 86vh;
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
