:root {
    --doer-blue: #2f57d3;
    --doer-blue-deep: #203aa6;
    --doer-ink: #0f172a;
    --doer-slate: #475569;
    --doer-border: rgba(15, 23, 42, 0.08);
    --doer-surface: #ffffff;
    --doer-surface-soft: #f8fafc;
    --doer-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --doer-radius: 24px;
}

body.portal-body,
body.admin-body {
    background:
        radial-gradient(circle at top left, rgba(47, 87, 211, 0.14), transparent 26rem),
        linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
    color: var(--doer-ink);
}

.portal-shell,
.admin-shell {
    min-height: 100vh;
}

.admin-frame {
    gap: 1.5rem;
}

.admin-content {
    padding-bottom: 2rem;
}

.admin-page-head,
.portal-page-head {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.5rem 0 1.25rem;
}

.admin-page-kicker,
.portal-page-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--doer-blue);
}

.admin-page-title,
.portal-page-title {
    margin: 0;
    font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem);
    line-height: 1.04;
    font-weight: 800;
    color: var(--doer-ink);
}

.admin-page-copy,
.portal-page-copy {
    max-width: 48rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--doer-slate);
}

.admin-sidebar {
    background: linear-gradient(180deg, #101c44 0%, #203aa6 50%, #2f57d3 100%);
    color: rgba(255, 255, 255, 0.88);
    box-shadow: var(--doer-shadow);
}

.admin-sidebar .brand-mark {
    height: 2.75rem;
    width: 2.75rem;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.admin-sidebar .brand-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.admin-sidebar .brand-wordmark strong {
    color: #fff;
    font-size: 1.05rem;
}

.admin-sidebar .brand-wordmark span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-sidebar h2,
.admin-sidebar hr,
.admin-sidebar a,
.admin-sidebar button {
    border-color: rgba(255, 255, 255, 0.14) !important;
}

.admin-sidebar a,
.admin-sidebar button {
    color: rgba(255, 255, 255, 0.82);
}

.admin-sidebar h2 {
    color: rgba(255, 255, 255, 0.72) !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-nav-item {
    margin: 0.2rem 0.65rem;
    border-radius: 1rem;
}

.admin-nav-link,
.admin-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.85rem;
    padding: 0.82rem 0.95rem;
    border-radius: 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.admin-nav-link:hover,
.admin-nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-nav-link.active,
.admin-nav-button.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.admin-nav-icon {
    width: 1.1rem;
    text-align: center;
}

.admin-nav-menu {
    margin: 0.55rem 0 0.15rem;
    padding: 0.55rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
}

.admin-nav-subitem a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
}

.admin-nav-subitem a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-topbar,
.portal-topbar {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.admin-topbar .header-badge,
.portal-topbar .header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.52rem 0.82rem;
    background: rgba(47, 87, 211, 0.08);
    color: var(--doer-blue-deep);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-topbar .header-badge i,
.portal-topbar .header-badge i {
    font-size: 0.88rem;
}

.portal-nav-shell {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(47, 87, 211, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    box-shadow: var(--doer-shadow);
    backdrop-filter: blur(16px);
}

.portal-nav-shell a,
.portal-nav-shell button,
.portal-nav-shell span {
    color: #f8fbff;
}

.portal-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.85rem;
    padding: 0.72rem 0.95rem;
    border-radius: 999px;
    font-size: 0.94rem;
    font-weight: 700;
    color: rgba(248, 251, 255, 0.84) !important;
    transition: background-color 120ms ease, color 120ms ease;
}

.portal-link:hover,
.portal-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.portal-brand img {
    height: 2.4rem !important;
    filter: brightness(0) invert(1);
}

.portal-card,
.portal-table-card,
.portal-panel,
.metric-card {
    background: var(--doer-surface);
    border: 1px solid var(--doer-border);
    border-radius: var(--doer-radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.metric-card {
    padding: 1.2rem 1.25rem;
    min-height: 100%;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--doer-blue), #5d79ef);
    box-shadow: 0 12px 30px rgba(47, 87, 211, 0.28);
}

.metric-card p:last-child,
.metric-card .metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--doer-ink);
}

.portal-table-card table {
    min-width: 100%;
}

.portal-table-card thead tr {
    background: #eff5ff !important;
}

.portal-table-card thead th {
    color: #37517a !important;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.portal-table-card tbody tr {
    transition: background-color 120ms ease, transform 120ms ease;
}

.portal-table-card tbody tr:hover {
    background: rgba(47, 87, 211, 0.03);
}

.portal-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}

.portal-toolbar form {
    width: 100%;
}

.portal-search {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-search-input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    color: var(--doer-ink);
}

.portal-search-action,
.portal-primary-btn,
.portal-secondary-btn,
.portal-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.portal-search-action,
.portal-primary-btn {
    background: linear-gradient(135deg, var(--doer-blue), #5d79ef);
    color: #fff !important;
    box-shadow: 0 16px 30px rgba(47, 87, 211, 0.22);
}

.portal-secondary-btn {
    background: rgba(47, 87, 211, 0.08);
    color: var(--doer-blue-deep) !important;
}

.portal-search-action,
.portal-primary-btn,
.portal-secondary-btn {
    min-height: 3rem;
    padding: 0.78rem 1.15rem;
}

.portal-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    color: #fff !important;
}

.portal-icon-btn.edit {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.portal-icon-btn.view {
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
}

.portal-icon-btn.delete {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.portal-primary-btn:hover,
.portal-search-action:hover,
.portal-secondary-btn:hover,
.portal-icon-btn:hover {
    transform: translateY(-1px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.portal-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--doer-slate);
}

.portal-footer,
.admin-footer {
    color: #64748b;
    font-size: 0.9rem;
}

.portal-section {
    padding: 0 1rem 1.5rem;
}

.portal-wallet-grid,
.portal-stats-grid {
    display: grid;
    gap: 1rem;
}

.portal-map-card {
    overflow: hidden;
}

.portal-history-grid {
    display: grid;
    gap: 1rem;
}

.portal-history-item {
    padding: 1.15rem;
}

@media (min-width: 768px) {
    .portal-toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .portal-search {
        flex-direction: row;
        align-items: center;
    }

    .portal-search-action {
        flex-shrink: 0;
    }

    .portal-wallet-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    }

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

@media (min-width: 1280px) {
    .portal-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body.portal-body,
body.admin-body {
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #0f172a;
}

.admin-shell {
    align-items: stretch;
    background:
        radial-gradient(circle at 0% 0%, rgba(47, 87, 211, 0.12), transparent 28rem),
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.1), transparent 24rem),
        linear-gradient(180deg, #f6f8fc 0%, #eef2f8 100%);
}

.admin-main-wrap,
.portal-main-wrap {
    width: min(100%, 1480px);
}

.admin-frame {
    padding-bottom: 2rem;
}

.admin-content,
.portal-shell {
    position: relative;
    z-index: 1;
}

.admin-sidebar {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 2rem 2rem 0;
    overflow: hidden;
}

.admin-sidebar-inner {
    display: flex;
    flex-direction: column;
}

.admin-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.86);
}

.admin-sidebar-meta strong {
    font-size: 0.96rem;
    color: #fff;
}

.admin-sidebar-meta span:last-child {
    font-size: 0.78rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
}

.admin-sidebar-meta-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.admin-topbar {
    position: sticky;
    top: 1rem;
    z-index: 12;
}

.admin-topbar-grid {
    min-height: 5.25rem;
}

.admin-topbar-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.admin-topbar-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4260b3;
}

.admin-topbar-heading {
    font-size: 1.15rem;
    line-height: 1.2;
    color: #0f172a;
}

.admin-topbar-subheading {
    font-size: 0.84rem;
    color: #64748b;
}

.admin-page-head,
.portal-page-head {
    margin-top: 1.8rem;
    margin-bottom: 1.6rem;
}

.admin-hero-panel,
.portal-flow-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.3rem;
    border-radius: 1.5rem;
    background:
        linear-gradient(135deg, rgba(18, 33, 82, 0.95), rgba(47, 87, 211, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    color: #f8fbff;
    box-shadow: 0 24px 50px rgba(20, 32, 74, 0.22);
}

.admin-hero-title {
    margin: 0.3rem 0 0;
    font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.admin-hero-copy {
    max-width: 44rem;
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.admin-hero-chip {
    align-self: flex-start;
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.95rem 1.05rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-hero-chip span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.64);
}

.admin-hero-chip strong {
    font-size: 1.2rem;
    color: #fff;
}

.portal-flow-banner {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.92)),
        linear-gradient(135deg, rgba(47, 87, 211, 0.04), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #0f172a;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.portal-flow-banner--compact {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.portal-flow-step {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.portal-flow-step span {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--doer-blue), #6b7ff5);
    box-shadow: 0 14px 22px rgba(47, 87, 211, 0.18);
}

.portal-flow-step strong {
    font-size: 0.96rem;
    color: #14213d;
}

.portal-section-title {
    letter-spacing: -0.03em;
}

.portal-card,
.portal-table-card,
.portal-panel,
.metric-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(148, 163, 184, 0.18);
}

.portal-card::before,
.portal-table-card::before,
.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(47, 87, 211, 0.22), rgba(56, 189, 248, 0.06), transparent);
}

.metric-card {
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1.4rem;
}

.metric-card p:first-child {
    margin-bottom: 0.2rem !important;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b !important;
}

.metric-card p:last-child,
.metric-card .metric-value {
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.metric-icon {
    width: 3.45rem;
    height: 3.45rem;
    border-radius: 1.15rem;
}

.portal-table-card,
.portal-map-card {
    border-radius: 1.6rem;
}

.portal-table-card {
    padding: 0.4rem;
}

.portal-table-card .w-full.overflow-x-auto {
    border-radius: 1.25rem;
}

.portal-table-card thead tr {
    background: linear-gradient(180deg, #f5f8ff, #edf3ff) !important;
}

.portal-table-card thead th {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.portal-table-card tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.portal-toolbar {
    gap: 1rem;
}

.portal-search {
    gap: 0.85rem;
}

.portal-search-input {
    min-height: 3.3rem;
    padding: 1rem 1.05rem;
    border-radius: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.portal-search-input:focus {
    border-color: rgba(47, 87, 211, 0.36);
    box-shadow: 0 0 0 4px rgba(47, 87, 211, 0.12);
}

.portal-primary-btn,
.portal-search-action,
.portal-secondary-btn {
    min-height: 3.15rem;
    border-radius: 1rem;
}

.portal-secondary-btn {
    border: 1px solid rgba(47, 87, 211, 0.12);
}

.portal-nav-shell {
    width: calc(100% - 1.5rem) !important;
    margin-left: 0.75rem !important;
    margin-top: 0.75rem !important;
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
    border-radius: 1.45rem;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(24, 39, 92, 0.92) 52%, rgba(47, 87, 211, 0.92));
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
}

.portal-brand span {
    color: rgba(255, 255, 255, 0.76);
}

.portal-profile-trigger {
    gap: 0.7rem;
    padding: 0.45rem 0.6rem 0.45rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: #f8fbff;
}

.portal-dropdown {
    border-radius: 1rem;
    border-color: rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}

.portal-shell {
    padding: 0 0.75rem;
}

.portal-section {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 0 0.35rem 1.75rem;
}

.portal-checkout-grid {
    align-items: start;
}

.portal-footer,
.admin-footer {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding-inline: 1rem;
}

.portal-footer p,
.admin-footer div {
    color: #64748b;
}

@media (min-width: 768px) {
    .admin-hero-panel,
    .portal-flow-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .portal-flow-banner {
        gap: 1.4rem;
    }

    .portal-flow-step {
        flex: 1 1 0;
    }

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

@media (min-width: 1100px) {
    .portal-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .admin-topbar {
        top: 0.75rem;
    }

    .portal-shell {
        padding: 0 0.35rem;
    }

    .portal-nav-shell {
        width: calc(100% - 1rem) !important;
        margin-left: 0.5rem !important;
        margin-top: 0.5rem !important;
    }

    .portal-flow-step strong {
        font-size: 0.92rem;
    }
}
