/* PRT Farm theme pulled from the desktop app palette. */
:root {
    --prt-bg: #2b2b2b;
    --prt-bg-deep: #1e1e1e;
    --prt-bg-soft: #232323;
    --prt-surface: #323232;
    --prt-surface-hover: #3a3a3a;
    --prt-border: #404040;
    --prt-border-strong: #505050;
    --prt-text: #e0e0e0;
    --prt-text-muted: #b0b0b0;
    --prt-gold: #b8860b;
    --prt-gold-hover: #d49d12;
    --prt-gold-bright: #f39c12;
    --prt-blue: #2980b9;
    --prt-blue-hover: #3498db;
    --prt-green: #27ae60;
    --prt-green-hover: #2ecc71;
    --prt-red: #c0392b;
    --prt-red-hover: #e74c3c;
}

body {
    background-color: var(--prt-bg) !important;
    color: var(--prt-text) !important;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--prt-gold) 0%, var(--prt-green) 52%, var(--prt-blue) 100%) !important;
}

/* Neutral surfaces */
.bg-white,
.bg-gray-50,
.bg-gray-100 {
    background-color: var(--prt-surface) !important;
    color: var(--prt-text) !important;
}

.bg-gray-200 {
    background-color: var(--prt-surface-hover) !important;
}

.bg-gray-800,
.bg-gray-900 {
    background-color: var(--prt-bg-deep) !important;
}

.from-gray-50,
.from-gray-100,
.from-gray-700,
.from-gray-800,
.from-gray-900 {
    --tw-gradient-from: var(--prt-surface) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(50 50 50 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.via-gray-800 {
    --tw-gradient-to: rgb(35 35 35 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--prt-bg-soft) var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

.to-gray-100,
.to-gray-600,
.to-gray-900 {
    --tw-gradient-to: var(--prt-bg-deep) var(--tw-gradient-to-position) !important;
}

/* Brand color mapping */
.bg-purple-50,
.bg-purple-100 {
    background-color: rgba(184, 134, 11, 0.16) !important;
}

.bg-purple-500,
.bg-purple-600,
.hover\:bg-purple-600:hover,
.hover\:bg-purple-700:hover {
    background-color: var(--prt-gold) !important;
}

.bg-purple-700 {
    background-color: #8d6808 !important;
}

.text-purple-600,
.text-purple-700,
.hover\:text-purple-600:hover,
.hover\:text-purple-700:hover {
    color: var(--prt-gold-bright) !important;
}

.border-purple-200,
.border-purple-500,
.border-purple-600,
.hover\:border-purple-600:hover {
    border-color: var(--prt-gold) !important;
}

.bg-blue-50,
.bg-blue-100 {
    background-color: rgba(41, 128, 185, 0.18) !important;
}

.bg-blue-500,
.bg-blue-600,
.hover\:bg-blue-600:hover,
.hover\:bg-blue-700:hover {
    background-color: var(--prt-blue) !important;
}

.bg-blue-700 {
    background-color: #206691 !important;
}

.text-blue-100 {
    color: #d7ecfa !important;
}

.text-blue-600,
.text-blue-700,
.text-blue-800,
.hover\:text-blue-600:hover,
.hover\:text-blue-700:hover {
    color: var(--prt-blue-hover) !important;
}

.border-blue-200,
.border-blue-500,
.border-blue-600 {
    border-color: var(--prt-blue) !important;
}

.bg-green-50,
.bg-green-100,
.bg-emerald-50,
.bg-emerald-100 {
    background-color: rgba(39, 174, 96, 0.18) !important;
}

.bg-green-500,
.bg-green-600,
.bg-emerald-500,
.bg-emerald-600,
.hover\:bg-green-600:hover,
.hover\:bg-green-700:hover,
.hover\:bg-emerald-600:hover,
.hover\:bg-emerald-700:hover {
    background-color: var(--prt-green) !important;
}

.text-green-500,
.text-green-600,
.text-green-700,
.text-emerald-600,
.text-emerald-700 {
    color: var(--prt-green-hover) !important;
}

.border-green-200,
.border-green-400,
.border-green-500,
.border-emerald-200,
.border-emerald-500 {
    border-color: var(--prt-green) !important;
}

/* Tailwind gradient stops used across the app */
.from-purple-500,
.from-purple-600 {
    --tw-gradient-from: var(--prt-gold) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(184 134 11 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.from-blue-500,
.from-blue-600 {
    --tw-gradient-from: var(--prt-blue) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(41 128 185 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.via-blue-600 {
    --tw-gradient-to: rgb(41 128 185 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--prt-green) var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

.to-blue-600,
.to-indigo-600,
.to-indigo-700 {
    --tw-gradient-to: var(--prt-blue) var(--tw-gradient-to-position) !important;
}

.to-purple-600 {
    --tw-gradient-to: var(--prt-gold) var(--tw-gradient-to-position) !important;
}

.from-green-500,
.from-green-600,
.from-emerald-500 {
    --tw-gradient-from: var(--prt-green) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(39 174 96 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.to-green-600,
.to-emerald-600 {
    --tw-gradient-to: var(--prt-green-hover) var(--tw-gradient-to-position) !important;
}

/* Text, borders, forms */
.text-gray-300,
.text-gray-400,
.text-gray-500,
.text-gray-600,
.text-gray-700,
.text-gray-800,
.text-gray-900 {
    color: var(--prt-text-muted) !important;
}

h1.text-gray-800,
h2.text-gray-800,
h3.text-gray-800,
.font-bold.text-gray-800,
.font-semibold.text-gray-800,
.text-2xl.text-gray-800,
.text-3xl.text-gray-800,
.text-4xl.text-gray-800,
.text-5xl.text-gray-800 {
    color: var(--prt-text) !important;
}

.border-gray-100,
.border-gray-200,
.border-gray-300,
.border-gray-400,
.border-gray-700,
.border-gray-800 {
    border-color: var(--prt-border) !important;
}

input,
textarea,
select {
    background-color: var(--prt-bg-deep) !important;
    border-color: var(--prt-border) !important;
    color: var(--prt-text) !important;
}

input::placeholder,
textarea::placeholder {
    color: #777777 !important;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.focus\:ring-purple-600:focus,
.focus\:ring-blue-600:focus {
    --tw-ring-color: var(--prt-gold-bright) !important;
}

.focus\:outline-none:focus {
    outline-color: var(--prt-gold-bright) !important;
}

/* Hover and status surfaces */
.hover\:bg-gray-50:hover,
.hover\:bg-gray-100:hover,
.hover\:bg-blue-50:hover {
    background-color: var(--prt-surface-hover) !important;
}

.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24) !important;
}

.bg-transparent {
    background-color: transparent !important;
}

.text-white {
    color: #ffffff !important;
}

/* Public menu cleanup */
.dynamic-dropdown {
    min-width: 260px;
}

.dynamic-dropdown-large {
    left: auto !important;
    right: 0;
}

.dynamic-dropdown-panel {
    min-width: 260px;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    display: grid;
    gap: 4px;
    background-color: var(--prt-surface) !important;
}

.dynamic-dropdown-panel a {
    min-width: 0;
    font-size: 14px;
    line-height: 1.25;
}

.dynamic-dropdown-panel a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-dropdown-panel-large {
    width: min(760px, calc(100vw - 32px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px !important;
}

.dynamic-dropdown-panel-large a {
    padding: 9px 10px !important;
}

@media (min-width: 1280px) {
    .dynamic-dropdown-panel-large {
        width: min(920px, calc(100vw - 40px));
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Footer category list should stay compact even with many categories. */
.footer-main-grid {
    align-items: start;
}

.footer-view-all {
    color: var(--prt-blue-hover, #3498db);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.footer-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.footer-category-link {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

/* Product category filter should not turn the sidebar into a very tall menu. */
.products-category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

.products-category-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--prt-text-muted, #b0b0b0) !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.products-category-link i {
    width: 15px;
    flex: 0 0 15px;
    margin-top: 2px;
    font-size: 12px;
    text-align: center;
}

.products-category-link span {
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-category-link:hover {
    background-color: var(--prt-surface-hover, #3a3a3a) !important;
    color: var(--prt-text, #e0e0e0) !important;
}

.products-category-link.is-active {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.30), rgba(39, 174, 96, 0.24)) !important;
    color: var(--prt-gold-bright, #f39c12) !important;
}

/* Admin sidebar custom styles */
.sidebar-link:hover {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.18) 0%, rgba(39, 174, 96, 0.16) 100%) !important;
    border-color: rgba(184, 134, 11, 0.42) !important;
}

.sidebar-link:hover::before {
    background: linear-gradient(180deg, var(--prt-gold) 0%, var(--prt-green) 100%) !important;
}

.sidebar-link:hover .link-icon {
    color: var(--prt-gold-bright) !important;
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--prt-gold) 0%, var(--prt-green) 100%) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 8px 20px rgba(184, 134, 11, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.sidebar-link.active::before {
    background: rgba(255, 255, 255, 0.82) !important;
}

.menu-section-title {
    color: var(--prt-gold-bright) !important;
}

.badge {
    background: var(--prt-red) !important;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.68) !important;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 157, 18, 0.85) !important;
}

::-webkit-scrollbar-track {
    background: var(--prt-bg-deep) !important;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--prt-gold), var(--prt-green), var(--prt-blue)) !important;
}

.seller-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    vertical-align: -0.12em;
    color: #2f8df7;
    font-weight: 900;
    line-height: 1;
    text-shadow: none;
}

.seller-verified-mark {
    position: relative;
    display: inline-block;
    width: 1.22em;
    height: 1.22em;
    min-width: 1.22em;
    min-height: 1.22em;
    background: #2f8df7;
    filter: drop-shadow(0 2px 5px rgba(47, 141, 247, 0.36));
    clip-path: polygon(
        50% 0%,
        58% 17%,
        72% 5%,
        75% 25%,
        95% 21%,
        84% 39%,
        100% 50%,
        84% 61%,
        95% 79%,
        75% 75%,
        72% 95%,
        58% 83%,
        50% 100%,
        42% 83%,
        28% 95%,
        25% 75%,
        5% 79%,
        16% 61%,
        0% 50%,
        16% 39%,
        5% 21%,
        25% 25%,
        28% 5%,
        42% 17%
    );
}

.seller-verified-mark::after {
    content: '';
    position: absolute;
    left: 33%;
    top: 22%;
    width: 27%;
    height: 50%;
    border-right: 0.17em solid #ffffff;
    border-bottom: 0.17em solid #ffffff;
    transform: rotate(45deg);
    transform-origin: center;
}

.seller-verified-label {
    color: #2f8df7;
    font-size: 0.78em;
    letter-spacing: 0;
    font-weight: 900;
    white-space: nowrap;
}

.seller-rating-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--prt-text, #e0e0e0);
    font-weight: 800;
}

.seller-rating-summary.is-empty {
    color: var(--prt-text-muted, #b0b0b0);
}

.seller-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #6f6f6f;
    line-height: 1;
}

.seller-rating-stars .is-filled {
    color: var(--prt-gold-bright, #f39c12);
}

.seller-star-picker {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--prt-border, #404040);
}

.seller-star-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seller-star-picker label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #686868;
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    transition: color 0.16s ease, transform 0.16s ease, text-shadow 0.16s ease;
}

.seller-star-picker label span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.seller-star-picker label:hover,
.seller-star-picker label:hover ~ label,
.seller-star-picker input:checked ~ label {
    color: var(--prt-gold-bright, #f39c12);
    text-shadow: 0 0 16px rgba(243, 156, 18, 0.32);
}

.seller-star-picker label:hover {
    transform: translateY(-1px) scale(1.08);
}

.seller-star-picker input:focus-visible + label {
    outline: 2px solid var(--prt-blue-hover, #3498db);
    outline-offset: 4px;
    border-radius: 8px;
}

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

.seller-review-card {
    border-radius: 12px;
    border: 1px solid var(--prt-border, #404040);
    background: var(--prt-surface, #323232);
    padding: 16px;
}

.seller-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 12px;
    margin-bottom: 10px;
}

.seller-review-buyer {
    color: var(--prt-text, #e0e0e0);
    font-weight: 900;
}

.seller-review-product {
    color: var(--prt-gold-bright, #f39c12);
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
}

.seller-review-card p {
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 14px;
    line-height: 1.55;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .dynamic-dropdown-panel-large,
    .footer-category-list {
        grid-template-columns: 1fr;
    }

    .products-category-list {
        max-height: 250px;
    }

    .seller-review-grid {
        grid-template-columns: 1fr;
    }

    .seller-star-picker {
        gap: 6px;
        padding: 10px;
    }

    .seller-star-picker label {
        font-size: 30px;
    }
}

/* Admin and seller portal shell */
.admin-shell-page,
.seller-shell-page {
    background: var(--prt-bg-soft, #232323) !important;
}

.admin-shell-page *,
.seller-shell-page * {
    box-sizing: border-box;
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    background:
        linear-gradient(180deg, rgba(50, 50, 50, 0.86) 0%, rgba(35, 35, 35, 0.98) 100%),
        var(--prt-bg, #2b2b2b);
}

.portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #181818;
    border-right: 1px solid var(--prt-border, #404040);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.22);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 86px;
    padding: 20px;
    border-bottom: 1px solid var(--prt-border, #404040);
}

.portal-logo,
.portal-avatar,
.portal-top-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: #ffffff;
    font-weight: 900;
}

.portal-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--prt-gold, #b8860b), var(--prt-green, #27ae60));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.portal-logo-image img,
.portal-avatar-image img,
.portal-top-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.portal-brand-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.portal-brand-subtitle {
    margin-top: 3px;
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.portal-section + .portal-section {
    margin-top: 20px;
}

.portal-section-label {
    margin: 0 0 8px;
    padding: 0 10px;
    color: var(--prt-gold-bright, #f39c12) !important;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-nav .sidebar-link,
.portal-nav .seller-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin: 3px 0;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: none;
    transform: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.portal-nav .sidebar-link::before,
.portal-nav .seller-link::before {
    display: none;
}

.portal-link-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.portal-link-main span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-link-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #d8d8d8;
}

.portal-nav .sidebar-link:hover,
.portal-nav .seller-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(184, 134, 11, 0.34) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

.portal-nav .sidebar-link:hover .portal-link-icon,
.portal-nav .seller-link:hover .portal-link-icon {
    color: #ffffff !important;
    background: rgba(184, 134, 11, 0.22);
}

.portal-nav .sidebar-link.active,
.portal-nav .seller-link.active {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.96), rgba(39, 174, 96, 0.92)) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.portal-nav .sidebar-link.active .portal-link-icon,
.portal-nav .seller-link.active .portal-link-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.portal-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--prt-red, #c0392b);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.portal-link-arrow {
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 12px;
}

.portal-account {
    padding: 16px;
    border-top: 1px solid var(--prt-border, #404040);
}

.portal-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--prt-border, #404040);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.portal-user-card-link {
    color: inherit !important;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.portal-user-card-link:hover {
    border-color: var(--prt-gold, #b8860b);
    background: rgba(184, 134, 11, 0.12);
}

.portal-avatar,
.portal-top-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--prt-blue, #2980b9), var(--prt-green, #27ae60));
}

.portal-user-name,
.portal-user-meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-name {
    color: #ffffff;
    font-weight: 900;
}

.portal-user-meta {
    margin-top: 2px;
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 12px;
}

.portal-logout {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(192, 57, 43, 0.92);
    color: #ffffff !important;
    font-weight: 900;
    text-decoration: none;
}

.portal-logout:hover {
    background: var(--prt-red-hover, #e74c3c);
}

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

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--prt-border, #404040);
    background: rgba(35, 35, 35, 0.94);
    backdrop-filter: blur(12px);
}

.portal-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.portal-eyebrow {
    margin: 0;
    color: var(--prt-gold-bright, #f39c12);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.portal-title-row h1 {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.2;
}

.portal-subtitle {
    margin: 4px 0 0;
    color: var(--prt-text-muted, #b0b0b0);
    font-size: 13px;
}

.portal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid var(--prt-border, #404040);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--prt-text, #e0e0e0) !important;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.portal-chip:hover {
    border-color: var(--prt-gold, #b8860b);
    background: rgba(184, 134, 11, 0.12);
}

.portal-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 24px;
}

.portal-content > .bg-white,
.portal-content .bg-white.rounded-xl,
.portal-content .bg-white.rounded-lg {
    border: 1px solid var(--prt-border, #404040) !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22) !important;
}

.portal-content table {
    border-collapse: separate;
    border-spacing: 0;
}

.portal-content thead tr {
    background: rgba(255, 255, 255, 0.04) !important;
}

.portal-menu-button,
.portal-backdrop {
    display: none;
}

.portal-menu-button {
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--prt-border, #404040);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.portal-menu-button:hover {
    border-color: var(--prt-gold, #b8860b);
    background: rgba(184, 134, 11, 0.16);
}

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

    .portal-sidebar {
        position: fixed;
        left: 0;
        width: min(292px, calc(100vw - 44px));
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }

    body.portal-sidebar-open .portal-sidebar {
        transform: translateX(0);
    }

    .portal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        border: 0;
        background: rgba(0, 0, 0, 0.54);
    }

    body.portal-sidebar-open .portal-backdrop {
        display: block;
    }

    .portal-menu-button {
        display: inline-flex;
    }

    .portal-actions .portal-chip {
        display: none;
    }

    .portal-topbar {
        padding: 14px 16px;
    }

    .portal-content {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .portal-title-row h1 {
        font-size: 20px;
    }

    .portal-content {
        padding: 12px;
    }

    .portal-top-avatar {
        display: none;
    }
}
