:root {
    --navy-950: #071936;
    --navy-900: #0b2246;
    --navy-800: #11345d;
    --blue-500: #3f6df6;
    --purple-500: #7049f6;
    --teal-500: #08b69f;
    --teal-600: #00a891;
    --cyan-100: #dffcff;
    --mint-100: #d9fbef;
    --pink-100: #ffe4e8;
    --ink: #13224a;
    --muted: #66769a;
    --line: #dfebf6;
    --surface: #ffffff;
    --radius-sm: 7px;
    --radius-md: 10px;
    --radius-lg: 20px;
    --shadow-soft: 0 16px 44px rgba(9, 31, 67, .14);
    --shadow-card: 0 8px 22px rgba(29, 61, 111, .08);
    --space-1: .5rem;
    --space-2: .75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 0, rgba(8, 182, 159, .12), transparent 18rem),
        linear-gradient(160deg, #effbff 0%, #fbfdff 44%, #edf8ff 100%);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 0;
}

.portal-frame {
    width: 100%;
    min-width: 0;
}

.portal-frame--wide {
    width: 100%;
}

.panel {
    width: 100%;
    min-height: min(760px, calc(100vh - 2rem));
    padding: var(--space-4);
    border: 1px solid rgba(162, 223, 235, .85);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.panel--hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
    overflow: hidden;
}

.panel--owner,
.app-shell--owner .panel {
    color: #eef8ff;
    background:
        radial-gradient(circle at 96% 3%, rgba(6, 195, 204, .26), transparent 24rem),
        linear-gradient(150deg, var(--navy-950), var(--navy-900) 56%, #07142b);
}

.panel--partner,
.app-shell--partner .panel {
    background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.brand-mark {
    display: grid;
    grid-template-columns: repeat(2, 18px);
    gap: 5px;
    justify-content: center;
}

.brand-mark span {
    display: block;
    width: 18px;
    height: 34px;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--purple-500), var(--blue-500));
    transform: skewY(-38deg);
}

.brand-mark span:nth-child(3) {
    grid-column: 1 / 3;
    justify-self: center;
    height: 18px;
    background: linear-gradient(90deg, var(--teal-500), var(--blue-500));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.eyebrow {
    margin: 0 0 .35rem;
    color: var(--blue-500);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.panel--owner .eyebrow {
    color: #9ddfff;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 8vw, 2.4rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.muted {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.panel--owner .muted {
    color: #abc4df;
}

.portal-switch,
.metric-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(43, 100, 245, .24);
}

.btn--primary {
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}

.btn--teal {
    background: linear-gradient(135deg, #10cbb5, #009b89);
}

.btn--danger {
    background: linear-gradient(135deg, #ff5a75, #f2385d);
}

.metric-card {
    min-height: 96px;
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
}

.metric-card span {
    display: block;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 750;
    color: #52648b;
}

.metric-card strong {
    display: block;
    font-size: 1.25rem;
    color: var(--ink);
}

.metric-card--blue {
    background: #dff4ff;
}

.metric-card--mint {
    background: var(--mint-100);
}

.metric-card--pink {
    background: var(--pink-100);
}

.icon-button,
.avatar {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
}

.icon-button {
    background: rgba(255, 255, 255, .1);
}

.icon-button svg {
    width: 20px;
    fill: currentColor;
}

.avatar {
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}

.toast-region {
    position: fixed;
    right: var(--space-3);
    bottom: var(--space-3);
    display: grid;
    gap: var(--space-2);
    z-index: 50;
}

.toast {
    max-width: min(320px, calc(100vw - 2rem));
    padding: .85rem 1rem;
    color: #fff;
    background: var(--navy-900);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

@media (min-width: 620px) {
    .portal-switch,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-shell {
        padding: var(--space-4);
    }
}

.auth-card {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding: clamp(1.15rem, 5vw, 1.65rem);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.auth-card--owner {
    color: #eef8ff;
    background:
        radial-gradient(circle at 18% 100%, rgba(48, 100, 246, .34), transparent 14rem),
        radial-gradient(circle at 96% 4%, rgba(10, 190, 205, .24), transparent 16rem),
        linear-gradient(155deg, var(--navy-950), var(--navy-900) 58%, #07142b);
}

.auth-card--partner {
    background:
        radial-gradient(circle at 10% 100%, rgba(117, 187, 255, .34), transparent 13rem),
        linear-gradient(180deg, #fff, #f8fcff);
}

.auth-card::before,
.auth-card::after {
    content: "";
    position: absolute;
    left: -12%;
    right: -12%;
    bottom: -4rem;
    height: 12rem;
    border-radius: 50% 50% 0 0;
    pointer-events: none;
}

.auth-card--owner::before {
    background: rgba(63, 109, 246, .20);
    transform: rotate(8deg);
}

.auth-card--owner::after {
    bottom: -5.2rem;
    background: rgba(8, 182, 159, .16);
    transform: rotate(-7deg);
}

.auth-card--partner::before {
    background: rgba(69, 174, 255, .30);
    transform: rotate(-6deg);
}

.auth-card--partner::after {
    bottom: -5rem;
    background: rgba(129, 190, 255, .26);
    transform: rotate(7deg);
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.auth-heading {
    text-align: center;
}

.auth-heading h1 {
    font-size: 1.55rem;
}

.auth-heading p,
.form-help {
    margin: .35rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.form-help {
    text-align: center;
    font-size: .86rem;
}

.auth-card--owner .auth-heading p,
.auth-card--owner .form-help {
    color: #b8cae4;
}

.auth-form {
    display: grid;
    gap: .95rem;
}

.field {
    display: grid;
    gap: .45rem;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 750;
}

.field input {
    width: 100%;
    min-height: 45px;
    padding: 0 .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: rgba(255, 255, 255, .92);
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.pin-box:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(63, 109, 246, .14);
}

.pin-group {
    display: grid;
    grid-template-columns: repeat(4, 46px);
    justify-content: center;
    gap: .75rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.pin-group legend {
    grid-column: 1 / -1;
    margin-bottom: .1rem;
    font-size: .86rem;
    font-weight: 800;
}

.pin-box {
    width: 46px;
    height: 46px;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
    color: var(--ink);
    background: rgba(255, 255, 255, .94);
    outline: none;
}

.auth-card--owner .pin-group legend {
    color: #eef8ff;
}

.notice {
    padding: .85rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 750;
    line-height: 1.45;
}

.notice--error {
    color: #a51f34;
    background: #ffe5eb;
    border-color: #ffc8d2;
}

.notice--success {
    color: #057663;
    background: #ddfbf2;
    border-color: #b8f1e4;
}

.notice--info {
    color: #2248a8;
    background: #e7efff;
    border-color: #cbd9ff;
}

.portal-app {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: var(--space-3);
    padding: .75rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.portal-app--owner {
    color: var(--ink);
    background:
        radial-gradient(circle at 100% 0, rgba(8, 182, 159, .12), transparent 16rem),
        linear-gradient(180deg, #f3fbff, #ffffff 42%, #f8fcff);
}

.portal-app--partner {
    background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: .35rem .2rem .15rem;
}

.portal-app--owner .portal-header {
    margin: -.75rem -.75rem 0;
    padding: .95rem .95rem 1.05rem;
    color: #eef8ff;
    border-radius: 0 0 18px 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(63, 109, 246, .32), transparent 12rem),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.portal-app--owner .portal-header .eyebrow {
    color: #8de8ff;
}

.portal-header h1 {
    font-size: 1.35rem;
}

.menu-toggle {
    border: 0;
    color: inherit;
    cursor: pointer;
}

.portal-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: .55rem;
}

.portal-app .portal-nav.is-open {
    display: grid;
    grid-template-columns: 1fr;
}

.portal-nav form {
    margin: 0;
}

.nav-item {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .72rem .82rem;
    border: 0;
    border-radius: 9px;
    color: inherit;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
    font-weight: 800;
}

.portal-app--owner .nav-item {
    color: #eef8ff;
    background: rgba(255, 255, 255, .08);
}

.portal-app--owner .portal-nav .nav-item {
    color: #eef8ff;
}

.nav-item span:nth-child(2) {
    min-width: 0;
}

.nav-badge {
    min-width: 24px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    padding: .1rem .35rem;
    color: #071936;
    font-size: .72rem;
    font-weight: 900;
    border-radius: 999px;
    background: #d9fbef;
}

.portal-app--partner .nav-item {
    color: var(--ink);
    background: rgba(244, 248, 255, .92);
    border: 1px solid var(--line);
}

.nav-item svg {
    width: 18px;
    min-width: 18px;
    fill: currentColor;
}

.nav-item.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}

.nav-item--logout {
    color: #fff;
    background: linear-gradient(135deg, #ff5a75, #f2385d);
    font-weight: 800;
}

.portal-content {
    min-width: 0;
}

.content-card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow-card);
}

.content-card h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
}

.dashboard-stack {
    display: grid;
    gap: var(--space-3);
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background:
        radial-gradient(circle at 100% 0, rgba(8, 182, 159, .12), transparent 13rem),
        rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.dashboard-hero .btn {
    min-height: 40px;
    padding: .55rem .85rem;
    white-space: nowrap;
}

.dashboard-hero h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.28rem;
}

.filter-card {
    display: grid;
    gap: var(--space-2);
}

.field--compact span {
    font-size: .76rem;
}

.field select,
.field input[type="date"],
.field textarea {
    width: 100%;
    min-height: 43px;
    padding: 0 .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: #fff;
    outline: none;
}

.field select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, #6d7da2 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, #6d7da2 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
        #fff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.dash-card {
    min-width: 0;
    min-height: 100px;
    display: grid;
    align-content: space-between;
    gap: var(--space-2);
    padding: .82rem;
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.dash-card--blue {
    background: #dff4ff;
}

.dash-card--mint {
    background: var(--mint-100);
}

.dash-card--pink {
    background: var(--pink-100);
}

.dash-card__icon {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #3159db;
    border-radius: 10px;
    background: rgba(255, 255, 255, .7);
}

.dash-card__icon svg {
    width: 17px;
    fill: currentColor;
}

.dash-card span {
    color: #52648b;
    font-size: clamp(.72rem, 3.2vw, .86rem);
    font-weight: 800;
    line-height: 1.25;
}

.dash-card strong {
    min-width: 0;
    color: var(--ink);
    font-size: clamp(.98rem, 4.8vw, 1.28rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
}

.quick-link {
    min-height: 70px;
    display: grid;
    place-items: center;
    gap: .4rem;
    padding: .7rem .35rem;
    color: var(--ink);
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.quick-link svg {
    width: 20px;
    fill: var(--blue-500);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.section-title span {
    min-width: 28px;
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    color: #3159db;
    font-weight: 800;
    border-radius: 50%;
    background: #e9f0ff;
}

.empty-state {
    justify-items: center;
    text-align: center;
}

.empty-state--small {
    padding: var(--space-4) 0;
}

.empty-state--small p {
    margin: 0;
    color: var(--muted);
    font-weight: 750;
}

.empty-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--blue-500);
    border-radius: 16px;
    background: #edf4ff;
}

.empty-icon svg {
    width: 24px;
    fill: currentColor;
}

.activity-list {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-list li {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfdff;
}

.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: .35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-500), var(--teal-500));
}

.activity-list strong {
    display: block;
    color: var(--ink);
    font-size: .9rem;
}

.activity-list time {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
}

.notification-list {
    display: grid;
    gap: var(--space-2);
}

.notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
}

.notification-card.is-unread {
    border-color: rgba(63, 109, 246, .34);
    background:
        radial-gradient(circle at 100% 0, rgba(8, 182, 159, .12), transparent 12rem),
        #fff;
}

.notification-dot {
    width: 11px;
    height: 11px;
    margin-top: .35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-500), var(--teal-500));
}

.notification-body {
    display: grid;
    min-width: 0;
    gap: .45rem;
}

.notification-body time {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: .2rem;
}

.notification-actions form {
    margin: 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    align-items: center;
}

.section-head h2,
.section-head p {
    margin: 0;
}

.section-head p {
    margin-top: .25rem;
}

.partner-filters {
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.partner-filters .btn {
    min-height: 42px;
}

.partner-list {
    display: grid;
    gap: var(--space-2);
}

.transaction-list {
    display: grid;
    gap: var(--space-2);
}

.report-list {
    display: grid;
    gap: var(--space-2);
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0;
}

.mini-metrics div {
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfdff;
}

.mini-metrics dt,
.mini-metrics dd {
    margin: 0;
}

.mini-metrics dt {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
}

.mini-metrics dd {
    margin-top: .25rem;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.transaction-card {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.transaction-top,
.transaction-main {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    align-items: flex-start;
}

.transaction-top strong,
.transaction-main strong {
    display: block;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.transaction-top time,
.transaction-main span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.transaction-main {
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.partner-card,
.partner-detail-head {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3);
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.partner-detail-head {
    border-color: rgba(63, 109, 246, .14);
    background:
        radial-gradient(circle at 100% 0, rgba(63, 109, 246, .10), transparent 12rem),
        #fff;
}

.partner-avatar {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #fff;
    font-weight: 900;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}

.partner-avatar--large {
    width: 58px;
    height: 58px;
    font-size: 1.2rem;
}

.partner-main {
    min-width: 0;
}

.partner-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.partner-title h2,
.partner-detail-head h2 {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.partner-main p {
    margin: .25rem 0 0;
    color: #52648b;
    font-size: .82rem;
    font-weight: 700;
}

.partner-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.partner-card .partner-actions {
    align-self: center;
}

.mini-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: .55rem .8rem;
    color: #3159db;
    font-weight: 850;
    border: 1px solid #cbd9ff;
    border-radius: var(--radius-sm);
    background: #eef4ff;
}

.mini-button:hover,
.quick-link:hover {
    border-color: rgba(63, 109, 246, .35);
    background: #e9f1ff;
}

.badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
}

.badge--active {
    color: #057663;
    background: #c7f8e9;
}

.badge--approved {
    color: #057663;
    background: #c7f8e9;
}

.badge--open {
    color: #3159db;
    background: #dce7ff;
}

.badge--partially_recovered {
    color: #8a5b00;
    background: #fff1c7;
}

.badge--fully_recovered {
    color: #057663;
    background: #c7f8e9;
}

.badge--pending {
    color: #8a5b00;
    background: #fff1c7;
}

.badge--fired {
    color: #b21f3c;
    background: #ffd8e0;
}

.badge--unpaid {
    color: #8a5b00;
    background: #fff1c7;
}

.badge--partial {
    color: #3159db;
    background: #e2ebff;
}

.badge--paid,
.badge--blue {
    color: #057663;
    background: #c7f8e9;
}

.badge--in {
    color: #057663;
    background: #c7f8e9;
}

.badge--out {
    color: #b21f3c;
    background: #ffd8e0;
}

.badge--rejected {
    color: #b21f3c;
    background: #ffd8e0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
}

.detail-grid {
    display: grid;
    gap: var(--space-3);
}

.detail-list {
    display: grid;
    gap: var(--space-2);
    margin: 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--line);
}

.detail-list dt,
.detail-list dd {
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 750;
}

.detail-list dd {
    color: var(--ink);
    font-weight: 850;
    text-align: right;
    overflow-wrap: anywhere;
}

.check-row {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.5;
}

.settings-list {
    display: grid;
    gap: var(--space-2);
}

.setting-row {
    display: grid;
    gap: var(--space-2);
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfdff;
}

.setting-row .field {
    gap: .35rem;
}

.setting-row .field span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.setting-row strong,
.setting-row p {
    margin: 0;
}

.toggle-field {
    display: inline-flex;
    width: fit-content;
    min-height: 44px;
    align-items: center;
    gap: .55rem;
    padding: .45rem .7rem;
    border: 1px solid rgba(49, 89, 219, .2);
    border-radius: 999px;
    background: #edf4ff;
    color: var(--blue-500);
    font-weight: 900;
}

.toggle-field input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--teal-500);
}

.check-row input {
    width: 20px;
    min-width: 20px;
    height: 20px;
    margin-top: .12rem;
    accent-color: #3159db;
}

.reset-explainer {
    padding: var(--space-3);
    border: 1px solid #ffc8d2;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .06);
}

.reset-explainer strong {
    display: block;
    margin-bottom: .35rem;
}

.commission-card {
    background:
        radial-gradient(circle at 100% 0, rgba(8, 182, 159, .16), transparent 12rem),
        #fff;
}

.commission-card h2 {
    font-size: clamp(1.6rem, 8vw, 2.3rem);
}

.screenshot-grid {
    display: grid;
    gap: var(--space-3);
}

.screenshot-card {
    align-content: start;
}

.screenshot-thumb {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: #52648b;
    font-weight: 850;
    border: 1px dashed #b8d4ec;
    border-radius: var(--radius-sm);
    background: #f5faff;
    overflow: hidden;
}

.screenshot-thumb img,
[data-upload-preview] {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.screenshot-thumb--large {
    min-height: 320px;
}

.upload-drop {
    display: grid;
    gap: var(--space-2);
    justify-items: center;
    padding: var(--space-4);
    color: #52648b;
    text-align: center;
    border: 1px dashed #b8d4ec;
    border-radius: var(--radius-md);
    background: #f8fcff;
    cursor: pointer;
}

.upload-drop span {
    color: var(--ink);
    font-weight: 900;
}

.upload-drop strong {
    color: #3159db;
}

.upload-drop small {
    color: var(--muted);
    font-weight: 700;
}

.upload-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

[data-upload-preview] {
    display: none;
}

[data-upload-preview].is-visible {
    display: block;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    background: rgba(7, 25, 54, .78);
}

.image-modal.is-open {
    display: flex;
}

.image-modal__panel {
    width: min(100%, 960px);
    max-height: calc(100vh - 2rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid rgba(162, 223, 235, .5);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.image-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--ink);
}

.image-modal__close {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #ff5a75, #f2385d);
    cursor: pointer;
}

.image-modal img {
    width: 100%;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f5faff;
}

[hidden] {
    display: none !important;
}

.portal-app--partner {
    color: var(--ink);
}

.portal-app--partner .portal-header {
    margin: -.75rem -.75rem 0;
    padding: .95rem .95rem 1.05rem;
    color: #eef8ff;
    border-radius: 27px 27px 18px 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(8, 182, 159, .35), transparent 13rem),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.portal-app--partner .portal-header .muted {
    color: #bed0e8;
}

.portal-app--partner .portal-header .eyebrow {
    color: #7df3e4;
}

.portal-app--partner .portal-nav.is-open {
    padding: .7rem;
    border: 1px solid rgba(207, 226, 242, .9);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.portal-app--owner .portal-nav.is-open {
    padding: .7rem;
    border-radius: var(--radius-md);
    background:
        radial-gradient(circle at 100% 0, rgba(63, 109, 246, .20), transparent 12rem),
        linear-gradient(150deg, var(--navy-950), var(--navy-900));
    box-shadow: var(--shadow-card);
}

.auth-card--partner .brand-mark span,
.portal-app--partner .brand-mark span {
    background: linear-gradient(180deg, #18d2c0, #2b8af7);
}

.auth-card--partner .brand-mark span:nth-child(3),
.portal-app--partner .brand-mark span:nth-child(3) {
    background: linear-gradient(90deg, #14cbb6, #42adff);
}

.field span,
.pin-group legend {
    color: #2c3b66;
}

.auth-card--owner .field span {
    color: #eef8ff;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #9badc9;
}

.field textarea {
    min-height: 96px;
    padding: .8rem .85rem;
    resize: vertical;
}

.auth-form .btn {
    width: 100%;
}

.dashboard-stack > .content-card,
.dashboard-stack > .dashboard-hero,
.dashboard-stack > .partner-filters,
.dashboard-stack > .partner-list,
.dashboard-stack > .transaction-list,
.dashboard-stack > .report-list {
    min-width: 0;
}

.section-title h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.02rem;
}

.activity-list li > div,
.notification-body {
    min-width: 0;
}

.activity-list .mini-button,
.notification-actions .mini-button {
    width: fit-content;
    margin-top: .35rem;
}

.partner-card::after {
    content: "›";
    color: #9badc9;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}

.partner-card:has(.partner-actions)::after {
    display: none;
}

.partner-actions:has(.mini-button:only-child) {
    grid-template-columns: 1fr;
}

.partner-actions .mini-button {
    min-width: 0;
}

.content-card > .auth-form:first-child:last-child {
    gap: 1rem;
}

.detail-list div {
    align-items: center;
    min-width: 0;
}

.detail-list dt {
    max-width: 48%;
}

.detail-list dd {
    min-width: 0;
}

.reset-explainer {
    color: #8f1730;
    border-color: #ffc8d2;
    background: #ffe5eb;
}

.reset-explainer .muted {
    color: #9b3950;
}

.commission-card {
    border-color: rgba(8, 182, 159, .20);
}

.upload-drop {
    min-height: 170px;
}

.upload-drop::before {
    content: "⇧";
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--blue-500);
    font-size: 1.6rem;
    font-weight: 900;
    border-radius: 50%;
    background: #edf4ff;
}

.screenshot-card .content-card,
.screenshot-card {
    min-width: 0;
}

.screenshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.screenshot-thumb {
    min-height: 132px;
    aspect-ratio: 4 / 5;
}

.notification-card,
.transaction-card,
.partner-card {
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.notification-card:hover,
.transaction-card:hover,
.partner-card:hover {
    transform: translateY(-1px);
    border-color: rgba(63, 109, 246, .26);
}

@media (max-width: 374px) {
    .app-shell {
        padding: 0;
    }

    .auth-card,
    .portal-app {
        border-radius: 0;
    }

    .pin-group {
        grid-template-columns: repeat(4, 41px);
        gap: .55rem;
    }

    .pin-box {
        width: 41px;
        height: 41px;
    }

    .dashboard-grid,
    .mini-metrics {
        gap: .55rem;
    }

    .dash-card {
        min-height: 94px;
        padding: .7rem;
    }

    .quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .partner-card,
    .partner-detail-head,
    .transaction-card,
    .notification-card,
    .content-card {
        padding: .78rem;
    }
}

@media (min-width: 860px) {
    .app-shell {
        min-height: 100vh;
        place-items: center;
        padding: var(--space-4);
    }

    .auth-card {
        width: min(100%, 390px);
        min-height: min(760px, calc(100vh - 3rem));
        border: 1px solid rgba(162, 223, 235, .85);
        border-radius: 28px;
        box-shadow: var(--shadow-soft);
    }

    .portal-frame--wide {
        width: min(100%, 1120px);
    }

    .portal-app {
        width: min(100%, 1120px);
        min-height: min(830px, calc(100vh - 3rem));
        grid-template-columns: 245px 1fr;
        grid-template-rows: auto 1fr;
        padding: var(--space-4);
        gap: var(--space-4);
        border: 1px solid rgba(162, 223, 235, .85);
        border-radius: 28px;
        box-shadow: var(--shadow-soft);
    }

    .portal-header {
        grid-column: 2;
        grid-row: 1;
        padding: .35rem 0 .15rem;
    }

    .portal-app--partner .portal-header {
        margin: 0;
        padding: .95rem 1rem;
        border-radius: var(--radius-lg);
    }

    .menu-toggle {
        display: none;
    }

    .portal-nav {
        grid-column: 1;
        grid-row: 1 / 3;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        padding: .85rem;
        border-radius: 22px;
    }

    .portal-app--owner .portal-nav {
        background:
            radial-gradient(circle at 100% 0, rgba(63, 109, 246, .18), transparent 12rem),
            linear-gradient(150deg, var(--navy-950), var(--navy-900));
        box-shadow: var(--shadow-card);
    }

    .portal-app--partner .portal-nav {
        background: #fff;
        border: 1px solid var(--line);
        box-shadow: var(--shadow-card);
    }

    .portal-content {
        grid-column: 2;
    }

    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr) 420px;
        align-items: end;
    }

    .filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-card .btn {
        grid-column: 1 / -1;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-grid--secondary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .partner-filters {
        grid-template-columns: minmax(0, 1fr) 180px 140px;
        align-items: end;
    }

    .partner-card {
        grid-template-columns: auto minmax(0, 1fr) 190px;
    }

    .partner-actions {
        grid-column: auto;
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .screenshot-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1180px) {
    .portal-app {
        grid-template-columns: 260px 1fr;
    }
}
