:root {
    --font-sans: Inter, Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --bg: #f3f8fd;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --border: #dbe8f5;
    --text: #10233d;
    --text-muted: #60748d;
    --text-soft: #7d8ea5;
    --primary: #075cb3;
    --primary-bright: #1cb2f8;
    --teal: #199d9a;
    --green: #63ba1a;
    --lime: #b8ea11;
    --danger: #d83a52;
    --warning: #d98324;
    --success: #1f9d63;
    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 28px 80px rgba(7, 92, 179, 0.14);
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(28, 178, 248, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(99, 186, 26, 0.1), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 52%, #eef5fb 100%);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: #0d72d6;
}

button,
.button-link,
.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button,
.button-link,
.primary-action {
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(7, 92, 179, 0.18);
}

button.secondary,
.button-link.secondary {
    background: #ffffff;
    color: var(--primary);
    border-color: rgba(7, 92, 179, 0.18);
    box-shadow: none;
}

button:hover,
.button-link:hover,
.primary-action:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

button.secondary:hover,
.button-link.secondary:hover {
    color: var(--primary);
    background: #eef6ff;
}

.button-link.ghost,
.ghost {
    background: #ffffff;
    color: var(--primary);
    border-color: rgba(7, 92, 179, 0.18);
    box-shadow: none;
}

.button-link.ghost:hover,
.ghost:hover {
    background: #eef6ff;
    color: var(--primary);
}

.app-shell {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: clamp(220px, 22vw, 280px) minmax(0, 1fr);
    gap: 1.5rem;
    padding: clamp(0.85rem, 2vw, 1.2rem);
    min-height: 100vh;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 35, 78, 0.98), rgba(7, 92, 179, 0.96));
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.15rem;
    box-shadow: var(--shadow-lg);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.4rem 0.4rem 1.15rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.2;
}

.sidebar-brand p {
    margin: 0.3rem 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.brand-mark {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff, #dff4ff);
    color: var(--primary);
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(8, 35, 78, 0.18);
}

.brand-mark.auth {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
}

.sidebar .primary-action {
    width: 100%;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1cb2f8, #63ba1a);
    color: #0a1d35;
    box-shadow: 0 18px 28px rgba(4, 17, 36, 0.22);
}

.side-nav {
    display: grid;
    gap: 0.45rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

.side-nav a,
.side-logout {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 600;
}

.side-nav a:hover,
.side-logout:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-foot {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
}

.account-mini {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.account-mini span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-mini strong {
    color: #ffffff;
}

.page-shell {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 0.85rem;
    border-radius: 24px;
    padding: 0.68rem 0.95rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(7, 92, 179, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.welcome-block {
    display: grid;
}

.welcome-block span {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.welcome-block strong {
    font-size: 1rem;
}

.user-pill,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(7, 92, 179, 0.08);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: capitalize;
}

.page,
.public-shell {
    display: grid;
    gap: 1.3rem;
    min-height: 0;
    padding-right: 0.2rem;
}

.public-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 1rem auto;
    min-height: calc(100vh - 2rem);
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(7, 92, 179, 0.12);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.flash.error,
.flash.danger {
    border-color: rgba(216, 58, 82, 0.18);
    background: #fff5f6;
    color: #8a1d32;
}

.flash.success {
    border-color: rgba(31, 157, 99, 0.18);
    background: #f1fbf5;
    color: #176d46;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.page-head h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.08;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    margin: 0 0 0.65rem;
    border-radius: 999px;
    background: rgba(7, 92, 179, 0.08);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.actions,
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(7, 92, 179, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
    overflow: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.stat {
    grid-column: span 3;
    padding: 1.15rem 1.2rem;
}

.stat.success {
    background: linear-gradient(180deg, #ffffff, #f3fcf7);
}

.stat.warning {
    background: linear-gradient(180deg, #ffffff, #fff8ef);
}

.stat.emphasis {
    background: linear-gradient(180deg, #ffffff, #eef7ff);
}

.stat span {
    display: block;
    color: var(--text-muted);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 0.35rem;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.1;
}

.stat small {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-soft);
    font-size: 0.87rem;
}

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

.dashboard-grid.two-col {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.page-hero.compact,
.panel-card,
.auth-card {
    border: 1px solid rgba(7, 92, 179, 0.12);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-sm);
}

.page-hero.compact {
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.panel-card,
.auth-card {
    padding: 1.25rem;
}

.auth-card {
    max-width: 560px;
    margin: 3rem auto;
}

.stacked-form {
    display: grid;
    gap: 0.9rem;
}

.stacked-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.stacked-form input {
    width: 100%;
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 14px;
    padding: 0.78rem 0.9rem;
    color: var(--text-main);
    background: #ffffff;
    font: inherit;
}

.stacked-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(7, 92, 179, 0.12);
    outline: none;
}

.copy-box {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px dashed rgba(7, 92, 179, 0.28);
    border-radius: 16px;
    background: #f4f9ff;
    overflow-wrap: anywhere;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(28, 178, 248, 0.13), transparent 24%),
        linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.dashboard-hero h1,
.dashboard-hero p {
    margin: 0;
}

.dashboard-hero h1 {
    color: #08234e;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.08;
}

.dashboard-hero p:not(.hero-kicker) {
    max-width: 68ch;
    margin-top: 0.45rem;
    color: var(--text-muted);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.dashboard-screen-card {
    display: grid;
    grid-template-columns: minmax(260px, 0.48fr) minmax(0, 1.52fr);
    gap: 1.2rem;
    align-items: end;
    overflow: visible;
}

.subject-screen-panel {
    border: 1px solid rgba(7, 92, 179, 0.16);
    background:
        radial-gradient(circle at top right, rgba(28, 178, 248, 0.12), transparent 26%),
        linear-gradient(135deg, #ffffff, #f7fbff);
    box-shadow: 0 18px 44px rgba(7, 92, 179, 0.1);
}

.dashboard-screen-card h3,
.dashboard-screen-card p {
    margin: 0;
}

.dashboard-screen-card p:not(.hero-kicker) {
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.quick-screen-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.4fr) minmax(220px, 1fr) auto;
    gap: 0.7rem;
}

.adverse-search-form {
    grid-template-columns: minmax(220px, 1.1fr) minmax(150px, 0.7fr) minmax(170px, 0.8fr) auto;
}

.risk-summary .stat {
    position: relative;
    overflow: hidden;
    border-left: 5px solid rgba(7, 92, 179, 0.18);
}

.stat.risk-open {
    background: linear-gradient(180deg, #ffffff, #fff8ef);
    border-left-color: var(--warning);
}

.stat.risk-high {
    background: linear-gradient(180deg, #ffffff, #fff2f4);
    border-left-color: var(--danger);
}

.stat.risk-pending {
    background: linear-gradient(180deg, #ffffff, #eef7ff);
    border-left-color: var(--primary);
}

.stat.risk-monitoring {
    background: linear-gradient(180deg, #ffffff, #f2fbfb);
    border-left-color: var(--teal);
}

.metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.metric-head b {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--primary);
    background: rgba(7, 92, 179, 0.08);
    font-size: 0.72rem;
    font-weight: 900;
}

.config-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.config-strip small {
    color: var(--text-muted);
}

.config-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.36rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 900;
}

.config-chip.configured {
    color: #18754b;
    background: rgba(31, 157, 99, 0.1);
}

.config-chip.attention {
    color: #9a5a16;
    background: rgba(217, 131, 36, 0.14);
}

.dashboard-grid-primary {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.dashboard-table tbody tr:hover {
    background: #f5faff;
    box-shadow: inset 4px 0 0 rgba(7, 92, 179, 0.24);
}

.dashboard-table td small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-soft);
}

.adverse-alert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.adverse-alert-card {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.adverse-alert-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
}

.adverse-alert-card h4,
.adverse-alert-card p {
    margin: 0;
}

.adverse-alert-card p {
    color: var(--text-muted);
}

.alert-theme-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.alert-theme-list span {
    padding: 0.32rem 0.55rem;
    border-radius: 999px;
    color: var(--primary);
    background: #eef6ff;
    font-size: 0.76rem;
    font-weight: 900;
}

.alert-actions {
    display: grid;
    grid-template-columns: minmax(130px, 0.6fr) minmax(140px, 1fr) auto;
    gap: 0.5rem;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h3 {
    margin: 0;
    font-size: 1.12rem;
}

.section-head p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.section-head.compact {
    margin-top: 1.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 0.78rem 0.7rem;
    vertical-align: top;
}

th {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

label {
    display: grid;
    gap: 0.45rem;
    color: var(--text-muted);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.72rem 0.85rem;
    color: var(--text);
    background: #ffffff;
    font: inherit;
}

textarea {
    resize: vertical;
}

.stack-form {
    display: grid;
    gap: 0.8rem;
}

.hint {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: #eef6ff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge.likely-match {
    background: rgba(216, 58, 82, 0.1);
    color: #9c223a;
}

.badge.possible-match {
    background: rgba(217, 131, 36, 0.12);
    color: #9a5a16;
}

.badge.no-match {
    background: rgba(31, 157, 99, 0.1);
    color: #18754b;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(184, 234, 17, 0.2), transparent 24%),
        linear-gradient(135deg, #073f7c, #075cb3 54%, #159d9a);
    box-shadow: var(--shadow-md);
}

.admin-hero h1,
.admin-hero p {
    margin: 0;
}

.admin-hero p:not(.hero-kicker) {
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.86);
}

.admin-hero .hero-kicker {
    color: rgba(255, 255, 255, 0.76);
}

.hero-action {
    white-space: nowrap;
}

.admin-stats .stat {
    grid-column: span 2;
}

.admin-search-card,
.full-width-card {
    overflow: visible;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(6, minmax(130px, 1fr)) auto;
    gap: 0.7rem;
    align-items: center;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.admin-tabs a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.84rem;
}

.admin-tabs a.active {
    color: #ffffff;
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
}

.pip-card-nav {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.65rem;
    border: 1px solid rgba(7, 92, 179, 0.16);
    border-radius: 999px;
    background: rgba(248, 252, 255, 0.92);
    box-shadow: 0 14px 32px rgba(15, 64, 118, 0.10);
    backdrop-filter: blur(16px);
}

.pip-card-nav span {
    padding: 0 0.35rem 0 0.2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pip-card-nav a {
    border: 1px solid rgba(7, 92, 179, 0.18);
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    background: #ffffff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(15, 64, 118, 0.06);
}

.pip-card-nav a:hover,
.pip-card-nav a:focus {
    color: #ffffff;
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
}

#pip-results,
#review-queue,
#source-ingestion,
#excel-import,
#registry-ingestion,
#current-affairs,
#manual-records,
#add-record,
#relationships,
#data-quality,
#definitions {
    scroll-margin-top: 5.5rem;
}

/* Optimised PIP database workspace, benchmarked for a calmer admin review flow. */
.admin-hero {
    align-items: flex-start;
    padding: clamp(1.3rem, 2.6vw, 2rem);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(21, 94, 239, 0.12), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    border: 1px solid rgba(7, 92, 179, 0.12);
    box-shadow: var(--shadow-sm);
}

.admin-hero p:not(.hero-kicker) {
    max-width: 760px;
    margin-top: 0.75rem;
    color: var(--text-muted);
}

.admin-hero .hero-kicker {
    color: var(--primary);
    background: rgba(7, 92, 179, 0.08);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.7rem;
}

.admin-stats .stat {
    position: relative;
    overflow: hidden;
    min-height: 138px;
    border: 1px solid rgba(7, 92, 179, 0.12);
    border-radius: 22px;
    background: #ffffff;
}

.admin-stats .stat::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: rgba(7, 92, 179, 0.08);
}

.admin-stats .stat.warning::after {
    background: rgba(217, 131, 36, 0.12);
}

.admin-stats .stat.success::after {
    background: rgba(31, 157, 99, 0.10);
}

.admin-stats .stat.emphasis::after {
    background: rgba(21, 94, 239, 0.10);
}

.admin-stats .stat span,
.admin-stats .stat strong,
.admin-stats .stat small {
    position: relative;
    z-index: 1;
}

.admin-search-card {
    padding: 0;
    border-radius: 24px;
    overflow: visible;
}

.admin-search-card .card-body {
    padding: 1.35rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(150px, 1fr)) auto;
    gap: 0.8rem;
    align-items: end;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 850;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(96, 116, 141, 0.26);
    border-radius: 12px;
    padding: 0.68rem 0.78rem;
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(7, 92, 179, 0.12);
}

.filter-actions {
    display: flex;
    align-items: end;
}

.advanced-filters {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(7, 92, 179, 0.10);
}

.advanced-filters summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 850;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.85rem;
}

.admin-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.10);
    border-radius: 18px;
}

.admin-tools strong,
.admin-tools p {
    display: block;
    margin: 0;
}

.admin-tools p {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.results-toolbar {
    margin: -1.2rem -1.2rem 0.95rem;
    padding: 1.15rem 1.2rem;
    border-bottom: 1px solid rgba(7, 92, 179, 0.10);
    background: #ffffff;
}

.admin-table {
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.82rem 1rem;
    background: #f9fafb;
    color: #475467;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: 1rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(7, 92, 179, 0.09);
}

.admin-table tr:hover td {
    background: #f9fbff;
}

.profile-cell strong,
.profile-cell small,
.meta-stack span,
.meta-stack small {
    display: block;
}

.profile-cell small,
.meta-stack small {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.meta-stack {
    display: grid;
    gap: 0.2rem;
}

.confidence-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    background: rgba(96, 116, 141, 0.12);
    color: #4b5f77;
    font-size: 0.78rem;
    font-weight: 850;
    white-space: nowrap;
}

.confidence-pill.high {
    background: rgba(31, 157, 99, 0.1);
    color: #18754b;
}

.confidence-pill.medium {
    background: rgba(217, 131, 36, 0.12);
    color: #9a5a16;
}

.confidence-pill.low {
    background: rgba(216, 58, 82, 0.10);
    color: #9c223a;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(96, 116, 141, 0.22);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-muted);
}

dialog.record-dialog {
    width: min(1080px, calc(100vw - 2rem));
    max-height: min(760px, calc(100vh - 2rem));
    border: 0;
    border-radius: 24px;
    overflow: auto;
}

.dialog-head,
.dialog-foot {
    position: sticky;
    z-index: 2;
    background: #ffffff;
}

.dialog-head {
    top: 0;
}

.dialog-foot {
    bottom: 0;
}

.dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-height: none;
    min-width: 0;
    margin: 0;
    padding: 1.3rem;
    background: var(--bg);
    border: 0;
    border-radius: 0;
}

.detail-panel {
    padding: 1rem;
    border: 1px solid rgba(7, 92, 179, 0.10);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.detail-panel.full {
    grid-column: 1 / -1;
}

.detail-panel h4 {
    margin: 0 0 0.8rem;
}

.detail-list {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 0.55rem 0.75rem;
    margin: 0;
}

.detail-list dt {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 0.82rem;
}

@media (max-width: 1180px) {
    .filter-grid,
    .advanced-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .hero-actions,
    .admin-tools,
    .results-toolbar,
    .section-collapse-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-grid,
    .advanced-grid,
    .dialog-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel.full {
        grid-column: auto;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .tool-actions {
        justify-content: flex-start;
    }
}

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

/* Modal record details (Gmail-style pop-out) */
dialog.record-dialog {
    width: min(1100px, calc(100vw - 2rem));
    max-height: min(88vh, 980px);
    border: 1px solid rgba(16, 35, 61, 0.16);
    border-radius: var(--radius-md);
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

dialog.record-dialog::backdrop {
    background: rgba(5, 16, 28, 0.55);
}

.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.dialog-head h3 {
    margin: 0.25rem 0 0;
}

.icon-close {
    border: 1px solid rgba(16, 35, 61, 0.18);
    background: rgba(7, 92, 179, 0.06);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dialog-grid {
    padding: 1.1rem 1.2rem 0.6rem;
    overflow: auto;
    max-height: calc(88vh - 140px);
}

.dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.2rem 1.2rem;
    border-top: 1px solid var(--border);
}

.admin-table td small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-soft);
}

.section-collapse {
    display: block;
}

.section-collapse-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    padding: 0;
    margin: 0 0 0.9rem;
}

.section-collapse-summary::-webkit-details-marker {
    display: none;
}

.section-collapse-summary h3 {
    margin: 0;
}

.section-collapse-summary p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.section-collapse-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.field-collapse {
    min-width: 220px;
}

.field-collapse summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--primary);
    background: #eef6ff;
    border: 1px solid rgba(7, 92, 179, 0.14);
    font-weight: 900;
    list-style: none;
    transition: transform 0.16s ease, background 0.16s ease;
}

.field-collapse summary::-webkit-details-marker {
    display: none;
}

.field-collapse[open] summary {
    transform: rotate(90deg);
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
}

.collapsed-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
    padding: 0.75rem;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.collapsed-fields span {
    display: grid;
    gap: 0.18rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.collapsed-fields b {
    color: var(--text);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.truncate-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-pill,
.risk-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    background: #eef6ff;
    color: var(--primary);
}

.risk-level-badge,
.decision-badge,
.match-type-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.34rem 0.62rem;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.risk-level-badge.risk-high {
    background: #d83a52;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(216, 58, 82, 0.18);
}

.risk-level-badge.risk-medium {
    background: #d98324;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(217, 131, 36, 0.16);
}

.risk-level-badge.risk-needs-review,
.risk-level-badge.risk-no-adverse-media-found {
    background: rgba(217, 131, 36, 0.12);
    color: #9a5a16;
}

.risk-level-badge.risk-low {
    background: #1f9d63;
    color: #ffffff;
}

.risk-level-badge.risk-unknown {
    background: rgba(96, 116, 141, 0.12);
    color: #4b5f77;
}

.decision-badge {
    background: #eef6ff;
    color: var(--primary);
}

.decision-badge.decision-pending-review,
.decision-badge.decision-needs-review {
    background: rgba(217, 131, 36, 0.12);
    color: #9a5a16;
}

.decision-badge.decision-cleared,
.decision-badge.decision-false-positive {
    background: rgba(31, 157, 99, 0.1);
    color: #18754b;
}

.decision-badge.decision-escalated,
.decision-badge.decision-confirmed-match {
    background: rgba(216, 58, 82, 0.1);
    color: #9c223a;
}

.match-type-badge {
    background: #eef6ff;
    color: var(--primary);
}

.queue-filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(135px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.compact-action {
    min-height: 38px;
    padding: 0.58rem 0.85rem;
    border-radius: 12px;
    font-size: 0.86rem;
}

.risk-pill.no-adverse-media {
    background: rgba(31, 157, 99, 0.1);
    color: #18754b;
}

.risk-pill.pending-review {
    background: rgba(217, 131, 36, 0.12);
    color: #9a5a16;
}

.risk-pill.adverse-media-found,
.risk-pill.sanctions-match,
.risk-pill.procurement-risk,
.risk-pill.fraud-allegation {
    background: rgba(216, 58, 82, 0.1);
    color: #9c223a;
}

.row-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 800;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.8rem;
    min-width: 680px;
    padding: 1rem;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.detail-grid h4 {
    margin: 0 0 0.5rem;
}

.detail-grid p {
    margin: 0.3rem 0;
    color: var(--text-muted);
}

.action-links {
    color: var(--primary) !important;
    font-weight: 800;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.72rem;
    border-radius: 11px;
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(7, 92, 179, 0.16);
}

.table-action.secondary {
    color: var(--primary) !important;
    background: #eef6ff;
    box-shadow: none;
}

.bulk-edit-form {
    display: grid;
    gap: 1.2rem;
}

.bulk-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.bulk-grid-wrap {
    max-height: 68vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.bulk-grid {
    min-width: 1700px;
    border-collapse: separate;
    border-spacing: 0;
}

.bulk-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbff;
}

.bulk-grid th:first-child,
.bulk-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #ffffff;
    box-shadow: 8px 0 16px rgba(15, 23, 42, 0.04);
}

.bulk-grid th:first-child {
    background: #f8fbff;
    z-index: 4;
}

.bulk-grid th:nth-child(2),
.bulk-grid td:nth-child(2) {
    position: sticky;
    left: 76px;
    z-index: 3;
    background: #ffffff;
    box-shadow: 8px 0 16px rgba(15, 23, 42, 0.04);
}

.bulk-grid th:nth-child(2) {
    background: #f8fbff;
    z-index: 4;
}

.bulk-delete-cell {
    width: 76px;
    min-width: 76px;
    text-align: center;
}

.bulk-delete-cell input {
    min-width: 0;
    width: 18px;
    height: 18px;
}

.bulk-grid input,
.bulk-grid select,
.bulk-grid textarea {
    width: 100%;
    min-width: 150px;
    border: 1px solid rgba(96, 116, 141, 0.22);
    border-radius: 10px;
    padding: 0.48rem 0.55rem;
    font-size: 0.82rem;
    background: #ffffff;
}

.bulk-grid textarea {
    min-height: 42px;
    resize: vertical;
}

.bulk-grid tr:hover td {
    background: #fbfdff;
}

.empty-table-cell {
    padding: 1.4rem !important;
    color: var(--text-muted);
    background: #f8fbff;
}

.empty-table-cell strong,
.empty-table-cell small {
    display: block;
}

.empty-table-cell small {
    margin: 0.25rem 0 0.8rem;
    color: var(--text-soft);
}

.record-actions {
    display: grid;
    gap: 0.55rem;
}

.record-actions form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.record-actions .adverse-action {
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.edit-suggestion-panel {
    grid-column: 1 / -1;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(7, 92, 179, 0.1);
}

.edit-suggestion-panel summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 900;
}

.edit-record-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.8rem;
}

.edit-record-form label:has(textarea),
.edit-record-form button {
    grid-column: 1 / -1;
}

button.danger,
.danger {
    background: #d83a52;
    color: #ffffff;
}

.queue-list {
    display: grid;
    gap: 0.65rem;
}

.queue-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
    color: var(--text);
}

.queue-list span {
    color: var(--primary);
    font-weight: 900;
}

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

.labeled-form label:has(textarea),
.labeled-form button {
    grid-column: 1 / -1;
}

.compact-form {
    margin-top: 1rem;
}

.login-shell {
    display: grid;
    gap: 1.2rem;
}

.login-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: clamp(1.2rem, 3vw, 2rem);
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(184, 234, 17, 0.22), transparent 20%),
        linear-gradient(135deg, rgba(7, 92, 179, 0.98), rgba(28, 178, 248, 0.92) 62%, rgba(25, 157, 154, 0.9));
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.login-hero-content,
.login-plans {
    display: grid;
    gap: 1rem;
    align-content: center;
}

.login-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.login-eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.86);
}

.login-hero h1 {
    margin: 0;
    max-width: 20ch;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.04;
}

.login-hero-copy {
    margin: 0;
    max-width: 60ch;
    color: rgba(255, 255, 255, 0.92);
}

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.hero-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
}

.login-plan {
    position: relative;
    padding: 1.15rem 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.login-plan-bar {
    width: 4rem;
    height: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #b8ea11, #ffffff);
    margin-bottom: 0.9rem;
}

.login-plan h3 {
    margin: 0;
    color: #ffffff;
}

.login-plan ul {
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.login-plan li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.login-plan li span:last-child {
    color: rgba(255, 255, 255, 0.88);
}

.login-plan-dot {
    width: 0.5rem;
    height: 0.5rem;
    min-width: 0.5rem;
    border-radius: 999px;
    margin-top: 0.45rem;
    background: #b8ea11;
}

.login-auth-wrap {
    display: grid;
}

.login-card {
    padding: 1.4rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-md);
}

.login-auth-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.login-auth-title {
    margin: 0;
    font-size: 1.45rem;
}

.login-auth-subtitle,
.login-info-box p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
}

.login-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.login-info-box {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff, #eef6ff);
    border: 1px solid rgba(7, 92, 179, 0.12);
}

.login-info-box a {
    display: inline-flex;
    margin-top: 0.7rem;
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.login-submit {
    width: 100%;
}

.public-search-card {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: stretch;
    padding: 1.2rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.public-preview-copy {
    display: grid;
    gap: 1rem;
}

.preview-quota {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.8rem;
    align-items: center;
    padding: 1rem;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(28, 178, 248, 0.14), transparent 30%),
        linear-gradient(180deg, #ffffff, #eef7ff);
    border: 1px solid rgba(7, 92, 179, 0.16);
    box-shadow: var(--shadow-sm);
}

.preview-quota span {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.preview-quota strong {
    grid-row: span 2;
    min-width: 3.2rem;
    min-height: 3.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    font-size: 1.65rem;
    line-height: 1;
    box-shadow: 0 12px 26px rgba(7, 92, 179, 0.18);
}

.preview-quota small {
    color: var(--text-muted);
    font-weight: 700;
}

.preview-quota.is-empty {
    background:
        radial-gradient(circle at top right, rgba(216, 58, 82, 0.16), transparent 30%),
        linear-gradient(180deg, #ffffff, #fff2f4);
    border-color: rgba(216, 58, 82, 0.25);
}

.preview-quota.is-empty strong {
    background: linear-gradient(135deg, #9c223a, var(--danger));
    box-shadow: 0 12px 26px rgba(216, 58, 82, 0.18);
}

.public-search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.search-input-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.7rem;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(7, 92, 179, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.search-input-wrap > span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 0.65rem;
    border-radius: 999px;
    color: var(--primary);
    background: #eef6ff;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.search-input-wrap textarea {
    min-height: 96px;
    padding: 0.35rem 0;
    border: 0;
    border-radius: 0;
    outline: none;
}

.public-preview-panel {
    padding: 0.9rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #f8fbff, #edf6ff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.mockup-topbar {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

.mockup-topbar span {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: rgba(7, 92, 179, 0.28);
}

.public-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 0;
}

.public-result {
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.public-result div {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: flex-start;
}

.public-result h4 {
    margin: 0.8rem 0 0.35rem;
}

.public-result p {
    margin: 0;
    color: var(--text-muted);
}

.public-result small {
    display: block;
    margin-top: 0.7rem;
    color: var(--text-soft);
    font-weight: 800;
}

.current-affairs-section {
    position: relative;
    overflow: hidden;
}

.current-affairs-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 4% 0%, rgba(28, 178, 248, 0.12), transparent 28%),
        radial-gradient(circle at 96% 12%, rgba(184, 234, 17, 0.1), transparent 22%);
}

.current-affairs-section > * {
    position: relative;
}

.current-affairs-grid {
    display: grid;
    gap: 0.9rem;
}

.current-affairs-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
    padding: 0.85rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.adverse-demo-card {
    border-style: dashed;
}

.current-affairs-card img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.current-affairs-card h4 {
    margin: 0.7rem 0 0.35rem;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.current-affairs-card p {
    margin: 0;
    color: var(--text-muted);
}

.current-affairs-card small {
    display: block;
    margin-top: 0.8rem;
    color: var(--text-soft);
    font-weight: 800;
}

.issue-chip {
    display: inline-flex;
    padding: 0.42rem 0.65rem;
    border-radius: 999px;
    color: var(--primary);
    background: #eef6ff;
    font-size: 0.78rem;
    font-weight: 900;
}

.issue-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.issue-admin-row small {
    display: block;
    color: var(--text-soft);
    font-weight: 800;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.trust-strip span {
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    color: #0b3c68;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(7, 92, 179, 0.1);
    font-weight: 900;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.legal-notice-card {
    padding: 1.1rem 1.2rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(217, 131, 36, 0.12), transparent 26%),
        linear-gradient(180deg, #ffffff, #fff9f1);
    border: 1px solid rgba(217, 131, 36, 0.22);
    box-shadow: var(--shadow-sm);
}

.legal-notice-card h3,
.legal-notice-card p {
    margin: 0;
}

.legal-notice-card p:not(.hero-kicker) {
    margin-top: 0.35rem;
    color: var(--text-muted);
}

.app-notice {
    background:
        radial-gradient(circle at top right, rgba(7, 92, 179, 0.1), transparent 26%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    border-color: rgba(7, 92, 179, 0.14);
}

.public-use-warning,
.preview-disclaimer,
.cta-disclaimer,
.alert-disclaimer {
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    color: #7a4c0c;
    background: rgba(217, 131, 36, 0.1);
    border: 1px solid rgba(217, 131, 36, 0.18);
    font-size: 0.88rem;
    font-weight: 700;
}

.preview-disclaimer {
    margin: 0.8rem 0 0;
}

.cta-disclaimer,
.alert-disclaimer {
    margin-top: 0.8rem !important;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.alert-disclaimer {
    color: #7a4c0c;
    background: rgba(217, 131, 36, 0.1);
    border-color: rgba(217, 131, 36, 0.18);
}

.landing-section,
.landing-cta {
    padding: 1.2rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.landing-section h3,
.landing-cta h3 {
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.landing-grid,
.access-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.landing-feature,
.access-grid article {
    padding: 1rem;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(28, 178, 248, 0.13), transparent 28%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.landing-feature span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 900;
    font-size: 0.78rem;
}

.landing-feature h4,
.access-grid h4 {
    margin: 0.75rem 0 0.4rem;
}

.landing-feature p,
.access-grid p,
.landing-cta p {
    margin: 0;
    color: var(--text-muted);
}

.access-section {
    display: grid;
    grid-template-columns: minmax(240px, 0.6fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}

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

.subscriber-section {
    display: grid;
    grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
    gap: 1rem;
    align-items: start;
}

.subscriber-section h3 {
    margin: 0;
}

.subscriber-offers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.subscriber-offers article {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.subscriber-offers strong {
    color: var(--text);
}

.subscriber-offers span {
    color: var(--text-muted);
}

.pricing-section {
    overflow: visible;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.pricing-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.pricing-card.featured {
    border-color: rgba(7, 92, 179, 0.28);
    box-shadow: var(--shadow-md);
}

.pricing-card h4,
.pricing-card p {
    margin: 0;
}

.pricing-card > strong {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    color: var(--text);
}

.pricing-card small {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.pricing-card ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.signup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.signup-nav > div {
    display: flex;
    gap: 0.5rem;
}

.login-page-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
}

.login-price {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.login-price strong {
    color: #ffffff;
    font-size: 1.75rem;
}

.login-plan-discount {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.registration-card {
    overflow: visible;
}

.registration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.registration-grid .full {
    grid-column: 1 / -1;
}

.inline-check {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-muted);
}

.inline-check input {
    width: auto;
    min-height: auto;
    margin-top: 0.35rem;
}

.checkout-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.checkout-main,
.checkout-sidebar {
    display: grid;
    gap: 1rem;
}

.checkout-card {
    padding: 1.25rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(7, 92, 179, 0.1);
    box-shadow: var(--shadow-sm);
}

.checkout-step-card,
.checkout-card-head,
.checkout-product {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.checkout-step-card h1,
.checkout-card h2,
.checkout-card p {
    margin: 0;
}

.checkout-card p {
    color: var(--text-muted);
}

.checkout-step-icon,
.checkout-icon-circle,
.checkout-product-mark {
    display: inline-flex;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    font-weight: 900;
    flex: 0 0 auto;
}

.checkout-form-grid,
.checkout-bank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.checkout-bank-grid div,
.checkout-note-box {
    padding: 0.85rem;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.checkout-bank-grid span {
    display: block;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.checkout-note-box {
    margin-top: 1rem;
}

.checkout-product {
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 20px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.1);
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.checkout-summary-row.total strong {
    font-size: 1.6rem;
}

.checkout-terms,
.checkout-actions {
    margin-top: 1rem;
}

.checkout-actions {
    display: grid;
    gap: 0.65rem;
}

.industries-section {
    display: grid;
    grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
    gap: 1rem;
    align-items: center;
}

.industry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.industry-list span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.58rem 0.78rem;
    border-radius: 16px;
    color: var(--primary);
    background: #eef6ff;
    font-weight: 900;
}

.industry-list b {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #ffffff;
    color: var(--primary);
    font-size: 0.72rem;
    box-shadow: inset 0 0 0 1px rgba(7, 92, 179, 0.1);
}

.conversion-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1rem;
    align-items: stretch;
}

.landing-cta {
    display: grid;
    align-content: center;
    gap: 1rem;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(184, 234, 17, 0.22), transparent 24%),
        linear-gradient(135deg, #073f7c, #075cb3 58%, #159d9a);
}

.landing-cta .hero-kicker,
.landing-cta p {
    color: rgba(255, 255, 255, 0.82);
}

.merge-box {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(7, 92, 179, 0.12);
    border-radius: 20px;
    background: #f8fbff;
}

.profile-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    margin-top: 1rem;
    align-items: start;
}

.profile-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 24px;
    border: 1px solid rgba(7, 92, 179, 0.15);
    background: #eef6ff;
}

.developer-stats .stat {
    grid-column: span 2;
}

.developer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.developer-token-card {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: center;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 24px;
    background: #f4fff6;
    border: 1px solid rgba(39, 174, 96, 0.24);
}

.developer-token-card code,
.developer-code-block,
.endpoint-card code {
    display: block;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.85rem;
    border-radius: 16px;
    color: #dff7ff;
    background: #071b34;
}

.developer-key-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: end;
    margin: 1rem 0;
}

.endpoint-list {
    display: grid;
    gap: 0.8rem;
}

.endpoint-card {
    padding: 1rem;
    border-radius: 20px;
    background: #f8fbff;
    border: 1px solid rgba(7, 92, 179, 0.12);
}

.endpoint-card > div {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.endpoint-card span {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
}

.endpoint-card p {
    color: var(--text-muted);
}

.developer-code-block {
    margin-top: 1rem;
}

.developer-code-block pre {
    margin: 0;
}

.review-run-summary {
    margin-bottom: 1rem;
}

.review-run-form {
    display: grid;
    gap: 1rem;
}

.review-run-actions,
.review-run-toolbar,
.review-run-save-bar {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
}

.review-run-toolbar {
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(7, 92, 179, 0.14);
    border-radius: 18px;
    background: #f8fbff;
}

.review-run-toolbar label {
    flex: 1 1 360px;
}

.review-run-table-wrap {
    max-height: calc(100vh - 310px);
}

.review-run-table {
    min-width: 2300px;
}

.review-run-table th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.review-run-table td {
    min-width: 140px;
}

.review-run-table td:first-child,
.review-run-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 76px;
    background: #ffffff;
}

.review-run-table th:first-child {
    background: #f9fafb;
}

.review-run-table input,
.review-run-table select,
.review-run-table textarea {
    min-width: 130px;
}

.review-run-table textarea {
    min-width: 260px;
    resize: vertical;
}

.review-run-row.match-existing td,
.review-run-row.match-pre_eliminated td {
    background: #fff8f2;
}

.review-run-row.match-new td {
    background: #f7fff9;
}

.staged-match-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.staged-match-pill.new {
    color: #116149;
    background: #dff9ea;
}

.staged-match-pill.existing {
    color: #8a4b00;
    background: #fff1d6;
}

.staged-match-pill.pre_eliminated {
    color: #9f1a1a;
    background: #ffe2e2;
}

.staged-match-pill.incomplete,
.staged-match-pill.unknown {
    color: #4b5563;
    background: #edf2f7;
}

.match-detail {
    display: block;
    min-width: 220px;
    margin-top: 0.35rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.review-run-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(7, 92, 179, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.08);
}

.review-run-save-bar span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 1040px) {
    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

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

    .dashboard-grid,
    .login-hero,
    .dashboard-hero,
    .dashboard-screen-card,
    .dashboard-grid-primary,
    .developer-grid,
    .developer-token-card,
    .public-search-card,
    .trust-strip,
    .subscriber-section,
    .subscriber-offers,
    .pricing-grid,
    .registration-grid,
    .checkout-shell,
    .checkout-form-grid,
    .checkout-bank-grid,
    .conversion-section {
        grid-template-columns: 1fr;
    }

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

    .dashboard-actions {
        justify-content: flex-start;
    }

    .filter-bar,
    .labeled-form,
    .detail-grid,
    .public-results,
    .current-affairs-card,
    .landing-grid,
    .access-section,
    .access-grid,
    .industries-section {
        grid-template-columns: 1fr;
    }

    .quick-screen-form {
        grid-template-columns: 1fr;
    }

    .developer-stats .stat {
        grid-column: span 6;
    }

    .adverse-alert-grid,
    .adverse-search-form,
    .alert-actions,
    .queue-filter-bar {
        grid-template-columns: 1fr;
    }

    .record-actions form,
    .record-actions .adverse-action,
    .edit-record-form {
        grid-template-columns: 1fr;
    }

    .admin-stats .stat {
        grid-column: span 4;
    }

    .stat {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .page-head,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .side-nav,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat {
        grid-column: span 12;
    }

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

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

    .admin-stats .stat {
        grid-column: span 12;
    }

    .developer-stats .stat {
        grid-column: span 12;
    }

    .login-hero h1 {
        font-size: 2rem;
    }

    .profile-card {
        grid-template-columns: 1fr;
    }
}
