* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f5f6f8;
    color: #1f2937;
}

.topbar {
    background: #111827;
    color: white;
    padding: 14px 24px;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    margin-right: 12px;
}

.muted {
    color: #9ca3af;
}

.container {
    padding: 24px;
    max-width: 1800px;
    margin: 0 auto;
}

h1 {
    margin: 0 0 18px;
}

h2 {
    margin: 0 0 16px;
}

.stats {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.stat {
    background: white;
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 130px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat b {
    display: block;
    font-size: 24px;
}

.stat span {
    color: #6b7280;
}

.stat.ok b {
    color: #047857;
}

.stat.warn b {
    color: #b45309;
}

.stat.bad b {
    color: #b91c1c;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

input,
select,
button,
.button {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

input[type="text"] {
    min-width: 420px;
}

button,
.button {
    background: #111827;
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.button.secondary {
    background: white;
    color: #111827;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    font-size: 13px;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    position: sticky;
    top: 0;
}

.title {
    max-width: 360px;
}

.row-missing {
    background: #fff7ed;
}

.row-invalid {
    background: #fef2f2;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok {
    background: #d1fae5;
    color: #065f46;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.bad {
    background: #fee2e2;
    color: #991b1b;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
}

.grid span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
}

.grid b {
    font-size: 15px;
}

.back {
    display: inline-block;
    margin-bottom: 14px;
    color: #111827;
}

.price-form {
    display: flex;
    gap: 10px;
}

textarea {
    width: 100%;
    min-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px;
}

.nav {
    color: #d1d5db;
    text-decoration: none;
    margin-right: 14px;
    font-weight: 600;
}

.nav:hover {
    color: white;
}

.lead {
    color: #4b5563;
    font-size: 16px;
    margin-top: -8px;
    margin-bottom: 18px;
}

.calc-layout {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(420px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.wide-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.wide-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #374151;
    font-weight: 700;
}

.wide-form input {
    min-width: 0;
    width: 100%;
}

.big-button {
    grid-column: 1 / -1;
    font-size: 18px;
    padding: 14px 18px;
}

.result-card {
    position: sticky;
    top: 16px;
}

.result-status {
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 16px;
}

.result-status.ok {
    background: #d1fae5;
    color: #065f46;
}

.result-status.warn {
    background: #fef3c7;
    color: #92400e;
}

.result-status.bad {
    background: #fee2e2;
    color: #991b1b;
}

.result-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.result-main div {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px;
}

.result-main span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
}

.result-main b {
    font-size: 22px;
}

.mini-table {
    box-shadow: none;
    border-radius: 10px;
    font-size: 14px;
}

.mini-table td {
    padding: 10px;
}

.hint {
    color: #6b7280;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-form input {
    min-width: 520px;
}

.selected-product {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.4fr 1fr 1fr;
    gap: 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
}

.selected-product span {
    display: block;
    color: #4b5563;
    font-size: 12px;
    margin-bottom: 4px;
}

.selected-product b {
    font-size: 14px;
}

.button.small {
    padding: 6px 9px;
    font-size: 12px;
    display: inline-block;
}

.notice-ok {
    background: #d1fae5;
    color: #065f46;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.notice-warn {
    background: #fef3c7;
    color: #92400e;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.field-hint {
    display: block;
    color: #6b7280;
    font-weight: 500;
    font-size: 12px;
    margin-top: -2px;
}

.tariff-banner {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #312e81;
    padding: 14px 16px;
}

.tariff-banner.warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.tariff-banner a {
    margin-left: 10px;
    font-weight: 800;
    color: #312e81;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.main-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav {
    color: #d1d5db;
    text-decoration: none;
    margin-right: 0;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 10px;
}

.nav:hover {
    background: #374151;
    color: white;
}

.nav-primary {
    background: #7c3aed;
    color: white;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.action-card {
    display: block;
    background: white;
    border-radius: 18px;
    padding: 18px;
    text-decoration: none;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.action-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.action-card.primary {
    background: #7c3aed;
    color: white;
}

.action-card b {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.action-card span {
    color: inherit;
    opacity: 0.8;
}

.dashboard-stats {
    flex-wrap: wrap;
}

.log-box {
    background: #111827;
    color: #d1d5db;
    border-radius: 14px;
    padding: 16px;
    max-height: 520px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.45;
}

.calc-button {
    white-space: nowrap;
    background: #7c3aed;
}

.calc-big-link {
    display: inline-block;
    margin-bottom: 16px;
    background: #7c3aed;
}

@media (max-width: 1100px) {
    .quick-actions {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }
}

@media (max-width: 700px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    background: #fbfdff;
}

.form-section.section-main {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.section-header {
    margin-bottom: 14px;
}

.section-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #111827;
}

.section-header p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

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

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

.form-grid.three {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #374151;
    font-weight: 800;
}

.form-grid input {
    width: 100%;
    min-width: 0;
}

.sticky-calc-button {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

@media (max-width: 900px) {
    .form-grid.two,
    .form-grid.three {
        grid-template-columns: 1fr;
    }
}

.compact-info-section {
    padding: 12px 14px;
    background: #f9fafb;
}

.section-header.compact {
    margin-bottom: 10px;
}

.section-header.compact h3 {
    font-size: 16px;
}

.section-header.compact p {
    font-size: 12px;
}

.readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
}

.readonly-grid.tax-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.readonly-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 12px;
}

.readonly-box.wide {
    grid-column: span 1;
}

.readonly-box span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.readonly-box b {
    display: block;
    font-size: 15px;
    color: #111827;
}

@media (max-width: 900px) {
    .readonly-grid,
    .readonly-grid.tax-grid {
        grid-template-columns: 1fr;
    }

    .readonly-box.wide {
        grid-column: span 1;
    }
}

.nav.active {
    background: #7c3aed;
    color: white;
}

.nav.nav-primary {
    background: transparent;
}

.nav.nav-primary.active {
    background: #7c3aed;
}

.product-filters {
    align-items: center;
    flex-wrap: wrap;
}

.product-filters input[type="text"] {
    min-width: 360px;
    flex: 1 1 360px;
}

.product-filters select {
    max-width: 280px;
}

.table-note {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 14px;
}

@media (max-width: 900px) {
    .product-filters input[type="text"],
    .product-filters select {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
}

.products-table th.sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.products-table th.sortable a:hover {
    color: #7c3aed;
}

.sort-muted {
    color: #9ca3af;
    font-weight: 600;
}

.product-title-link {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}

.product-title-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.products-table td.title {
    min-width: 420px;
}

.products-table td,
.products-table th {
    vertical-align: top;
}

.products-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.products-table th,
.products-table td {
    border-right: 1px solid #e5e7eb;
}

.products-table th:last-child,
.products-table td:last-child {
    border-right: none;
}

.products-table th {
    border-bottom: 1px solid #d1d5db;
    background: #f9fafb;
}

.products-table tbody tr:hover {
    background: #faf5ff;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 22px 0 8px;
    flex-wrap: wrap;
}

.page-link,
.page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #111827;
    text-decoration: none;
    font-weight: 700;
}

.page-link:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.page-link.disabled {
    color: #9ca3af;
    background: #f9fafb;
    cursor: not-allowed;
}

.page-current {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #4c1d95;
}

.account-switcher {
    margin-left: auto;
}

.account-switcher form {
    margin: 0;
}

.account-switcher label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d1d5db;
    font-weight: 800;
    font-size: 13px;
}

.account-switcher select {
    min-width: 180px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #4b5563;
    background: #111827;
    color: white;
    font-weight: 800;
    padding: 0 10px;
}

@media (max-width: 900px) {
    .account-switcher {
        margin-left: 0;
        width: 100%;
    }

    .account-switcher label,
    .account-switcher select {
        width: 100%;
    }
}

.compact-lead {
    margin-top: -8px;
    margin-bottom: 16px;
}

.action-form {
    margin: 0;
}

.action-form .action-card {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-family: inherit;
}

.action-form .action-card.primary {
    border-color: #7c3aed;
}

.inline-form {
    margin: 12px 0 18px;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown .dropdown-toggle {
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown .dropdown-arrow {
    font-size: 11px;
    margin-left: 4px;
    opacity: 0.8;
}

.nav-dropdown.active > .nav {
    background: #7c3aed;
    color: #fff;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    padding: 8px;
    z-index: 50;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: #374151;
    color: #ffffff;
}

@media (max-width: 900px) {
    .nav-dropdown {
        width: 100%;
        display: block;
    }

    .nav-dropdown .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .dropdown-menu {
        position: static;
        display: block;
        margin-top: 6px;
        box-shadow: none;
    }
}

/* Fix dropdown flicker: remove hover gap between button and menu */
.nav-dropdown {
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
    z-index: 49;
}

.dropdown-menu {
    top: 100%;
    margin-top: 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

/* Make report dropdown easier to hit */
.dropdown-menu a {
    min-height: 22px;
    line-height: 22px;
}

.reports-actions {
    max-width: 1280px;
}

.notice-muted {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 700;
}


/* ============================================================
   Mobile layout
   ============================================================ */

@media (max-width: 760px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        margin: 0;
        font-size: 15px;
        overflow-x: hidden;
    }

    .topbar {
        position: static;
    }

    .topbar-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }

    .logo {
        font-size: 22px;
        line-height: 1.2;
        text-align: left;
    }

    .main-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .main-nav .nav,
    .nav-dropdown .dropdown-toggle {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
        padding: 10px 8px;
        font-size: 14px;
        border-radius: 12px;
    }

    .nav-dropdown {
        width: 100%;
        display: block;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .nav-dropdown::after {
        display: none;
    }

    .dropdown-menu {
        position: static;
        display: block;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
        box-sizing: border-box;
    }

    .dropdown-menu a {
        padding: 11px 10px;
        font-size: 14px;
        text-align: center;
    }

    .account-switcher {
        width: 100%;
        margin-left: 0;
    }

    .account-switcher form,
    .account-switcher label {
        width: 100%;
        display: block;
    }

    .account-switcher select {
        width: 100%;
        min-height: 42px;
        margin-top: 5px;
        font-size: 16px;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 12px;
        box-sizing: border-box;
    }

    h1 {
        font-size: 24px;
        line-height: 1.2;
        margin: 12px 0;
    }

    h2 {
        font-size: 19px;
        line-height: 1.25;
    }

    h3 {
        font-size: 16px;
    }

    .lead {
        font-size: 15px;
        line-height: 1.45;
    }

    .quick-actions,
    .reports-actions,
    .stats,
    .calc-layout,
    .calc-grid,
    .info-grid,
    .readonly-grid,
    .form-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .action-card,
    .card,
    .notice-warn,
    .notice-muted,
    .readonly-box,
    .stat {
        border-radius: 14px;
        box-sizing: border-box;
    }

    .action-card {
        min-height: 74px;
        padding: 14px;
    }

    .action-card b {
        font-size: 16px;
    }

    .action-card span {
        font-size: 13px;
        line-height: 1.35;
    }

    .card {
        padding: 12px;
        overflow: hidden;
    }

    .stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat {
        padding: 12px;
        min-height: 74px;
    }

    .stat b {
        font-size: 20px;
    }

    .stat span {
        font-size: 12px;
    }

    input,
    select,
    textarea,
    button,
    .button {
        font-size: 16px;
        min-height: 42px;
        box-sizing: border-box;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        width: 100%;
    }

    .button,
    button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: normal;
        text-align: center;
        padding: 10px 12px;
    }

    .button.small,
    .calc-button {
        min-height: 38px;
        padding: 9px 10px;
        font-size: 13px;
    }

    form {
        max-width: 100%;
    }

    table {
        min-width: 760px;
        font-size: 13px;
    }

    .products-table {
        min-width: 840px;
    }

    .card:has(table),
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        padding: 9px 8px;
        vertical-align: top;
    }

    td.title,
    .title {
        max-width: 260px;
        white-space: normal;
    }

    .log-box,
    pre {
        max-width: 100%;
        overflow-x: auto;
        font-size: 12px;
    }

    .inline-form {
        width: 100%;
    }

    .inline-form .button,
    .inline-form button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .main-nav {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr !important;
    }

    h1 {
        font-size: 22px;
    }

    .container {
        padding: 10px;
    }

    table {
        min-width: 720px;
    }
}


/* ============================================================
   Compact mobile menu override
   ============================================================ */

.mobile-menu {
    display: none;
}

.topbar-head {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.topbar-head .account-switcher {
    margin-left: auto;
}

@media (max-width: 760px) {
    .topbar-inner {
        gap: 8px;
    }

    .topbar-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .topbar-head .logo {
        font-size: 22px;
        text-align: center;
    }

    .topbar-head .account-switcher {
        margin-left: 0;
    }

    .desktop-nav {
        display: none !important;
    }

    .mobile-menu {
        display: block;
        width: 100%;
    }

    .mobile-menu summary {
        list-style: none;
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 14px;
        background: #111827;
        color: #ffffff;
        font-weight: 900;
        cursor: pointer;
        user-select: none;
    }

    .mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .mobile-menu[open] summary {
        border-radius: 14px 14px 10px 10px;
    }

    .mobile-menu[open] summary span {
        transform: rotate(180deg);
    }

    .mobile-nav {
        margin-top: 8px;
        padding: 8px;
        background: #111827;
        border: 1px solid #374151;
        border-radius: 14px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mobile-nav a,
    .mobile-nav-group b {
        min-height: 42px;
        padding: 10px;
        border-radius: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        text-decoration: none;
        color: #e5e7eb;
        background: #1f2937;
        font-weight: 800;
        box-sizing: border-box;
    }

    .mobile-nav a.active {
        background: #7c3aed;
        color: #ffffff;
    }

    .mobile-nav-group {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding-top: 4px;
        border-top: 1px solid #374151;
    }

    .mobile-nav-group b {
        grid-column: 1 / -1;
        background: transparent;
        color: #9ca3af;
        min-height: 28px;
        padding: 4px;
    }

    .main-nav {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .mobile-nav {
        grid-template-columns: 1fr;
    }

    .mobile-nav-group {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   Product images
   ============================================================ */

.photo-cell {
    width: 54px;
    min-width: 54px;
    text-align: center;
    position: relative;
}

.product-thumb {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 2px;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    z-index: 1;
}

.product-thumb:hover {
    transform: scale(3.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    z-index: 100;
    background: #ffffff;
}

.product-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.product-detail-photo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 8px;
}

@media (max-width: 760px) {
    .photo-cell {
        width: 58px;
        min-width: 58px;
    }

    .product-thumb {
        width: 46px;
        height: 46px;
    }

    .product-thumb:hover {
        transform: scale(2.2);
    }

    .product-detail-head {
        display: block;
    }

    .product-detail-photo {
        width: 120px;
        height: 120px;
        margin: 8px 0 12px;
    }
}


/* ============================================================
   Product image speed + larger preview
   ============================================================ */

.product-thumb {
    width: 52px !important;
    height: 52px !important;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 2px;
    box-sizing: border-box;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    will-change: transform;
}

.product-thumb:hover {
    transform: scale(5.2) !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    z-index: 999;
    position: relative;
    background: #ffffff;
}

.photo-cell {
    width: 74px !important;
    min-width: 74px !important;
    text-align: center;
    overflow: visible;
}

.products-table td,
.products-table th {
    overflow: visible;
}

.card:has(.products-table) {
    overflow-x: auto;
    overflow-y: visible;
}

@media (max-width: 760px) {
    .product-thumb {
        width: 54px !important;
        height: 54px !important;
    }

    .product-thumb:hover {
        transform: scale(3.2) !important;
    }

    .photo-cell {
        width: 76px !important;
        min-width: 76px !important;
    }
}


/* Deferred product image loading */
.product-thumb-deferred:not([src]) {
    background:
        linear-gradient(90deg, #f3f4f6 0%, #ffffff 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: thumbPulse 1.1s ease-in-out infinite;
}

@keyframes thumbPulse {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}


/* ============================================================
   High quality product photo preview
   Small image in row, big image on hover
   ============================================================ */

.product-photo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product-photo-wrap .product-thumb:hover {
    transform: none !important;
    box-shadow: none !important;
}

.product-photo-preview {
    display: none;
    position: absolute;
    left: 64px;
    top: -40px;
    width: 260px;
    height: 260px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
    padding: 10px;
    z-index: 5000;
    box-sizing: border-box;
}

.product-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-photo-wrap:hover .product-photo-preview {
    display: block;
}

.products-table td,
.products-table th,
.photo-cell {
    overflow: visible !important;
}

.card:has(.products-table) {
    overflow-x: auto;
    overflow-y: visible !important;
}

@media (max-width: 760px) {
    .product-photo-preview {
        left: 0;
        top: 62px;
        width: 220px;
        height: 220px;
    }
}


/* ============================================================
   High quality hover preview: thumbnail + big image
   ============================================================ */

.product-photo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product-photo-wrap .product-thumb:hover {
    transform: none !important;
    box-shadow: none !important;
}

.product-photo-preview {
    display: none;
    position: fixed;
    width: 320px;
    height: 320px;
    left: 140px;
    top: 120px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    padding: 12px;
    z-index: 99999;
    box-sizing: border-box;
    pointer-events: none;
}

.product-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-photo-wrap:hover .product-photo-preview {
    display: block;
}

.photo-cell,
.products-table td,
.products-table th {
    overflow: visible !important;
}

.card:has(.products-table) {
    overflow-x: auto;
    overflow-y: visible !important;
}

@media (max-width: 760px) {
    .product-photo-preview {
        width: 260px;
        height: 260px;
        left: 24px;
        top: 160px;
    }
}


/* Product detail image */
.product-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 22px;
    align-items: start;
    margin-bottom: 18px;
}

.product-detail-title h1 {
    margin-bottom: 8px;
}

.product-detail-image-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.product-detail-photo {
    width: 100%;
    height: 240px;
    object-fit: contain;
    display: block;
}

@media (max-width: 760px) {
    .product-detail-head {
        grid-template-columns: 1fr;
    }

    .product-detail-image-box {
        max-width: 280px;
    }

    .product-detail-photo {
        height: 220px;
    }
}


/* ============================================================
   Cleaner product detail layout
   ============================================================ */

.product-detail-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 220px !important;
    gap: 24px !important;
    align-items: start !important;
    margin-bottom: 18px !important;
    max-width: 1180px;
}

.product-detail-title h1 {
    font-size: 34px;
    line-height: 1.12;
    margin: 0 0 8px 0;
    max-width: 900px;
}

.product-detail-title .lead {
    margin: 0;
    font-size: 17px;
    color: #4b5563;
}

.product-detail-image-box {
    width: 220px;
    height: 220px;
    padding: 12px !important;
    border-radius: 18px !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

.product-detail-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

.product-detail-head + .quick-actions {
    max-width: 820px;
    margin-top: 12px;
    margin-bottom: 18px;
}

.product-detail-head + .quick-actions .action-card {
    min-height: 96px;
}

@media (max-width: 900px) {
    .product-detail-head {
        grid-template-columns: 1fr !important;
    }

    .product-detail-image-box {
        width: 220px;
        height: 220px;
    }

    .product-detail-title h1 {
        font-size: 28px;
    }
}

@media (max-width: 760px) {
    .product-detail-title h1 {
        font-size: 24px;
    }

    .product-detail-title .lead {
        font-size: 15px;
    }

    .product-detail-image-box {
        width: 180px;
        height: 180px;
    }
}


/* ============================================================
   Final product detail header layout
   Photo should not push action buttons down
   ============================================================ */

.product-detail-head {
    display: block !important;
    position: relative !important;
    min-height: 185px !important;
    margin-bottom: 8px !important;
    padding-right: 300px !important;
    max-width: none !important;
}

.product-detail-title h1 {
    font-size: 34px !important;
    line-height: 1.12 !important;
    margin: 0 0 8px 0 !important;
    max-width: 980px !important;
}

.product-detail-title .lead {
    margin: 0 !important;
    font-size: 17px !important;
    color: #4b5563 !important;
}

.product-detail-image-box {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 240px !important;
    height: 180px !important;
    padding: 12px !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    box-sizing: border-box !important;
}

.product-detail-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.product-detail-head + .quick-actions {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    max-width: 660px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
}

.product-detail-head + .quick-actions .action-card {
    min-height: 104px !important;
    padding: 18px 20px !important;
}

@media (max-width: 900px) {
    .product-detail-head {
        min-height: auto !important;
        padding-right: 0 !important;
    }

    .product-detail-image-box {
        position: static !important;
        width: 220px !important;
        height: 180px !important;
        margin-top: 14px !important;
    }

    .product-detail-head + .quick-actions {
        grid-template-columns: 1fr !important;
        max-width: none !important;
        margin-top: 14px !important;
    }

    .product-detail-title h1 {
        font-size: 28px !important;
    }
}

@media (max-width: 760px) {
    .product-detail-title h1 {
        font-size: 24px !important;
    }

    .product-detail-title .lead {
        font-size: 15px !important;
    }

    .product-detail-image-box {
        width: 180px !important;
        height: 150px !important;
    }
}


/* ============================================================
   Product detail final clean layout
   ============================================================ */

.product-page-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 24px !important;
    align-items: start !important;
    margin: 18px 0 22px 0 !important;
}

.product-page-main {
    min-width: 0;
}

.product-page-main h1 {
    margin: 0 0 8px 0 !important;
    font-size: 34px !important;
    line-height: 1.12 !important;
    max-width: 980px !important;
}

.product-meta-line {
    margin: 0 0 22px 0 !important;
    color: #4b5563 !important;
    font-size: 17px !important;
}

.product-page-actions {
    display: grid !important;
    grid-template-columns: 260px 260px !important;
    gap: 16px !important;
    max-width: 540px !important;
}

.product-page-actions .action-card {
    min-height: 104px !important;
    padding: 18px 20px !important;
    box-sizing: border-box !important;
}

.product-page-photo-cell {
    width: 260px !important;
    height: 220px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    padding: 14px !important;
    box-sizing: border-box !important;
}

.product-page-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.product-page-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-weight: 800;
    background: #f9fafb;
    border-radius: 14px;
}

.product-stats {
    max-width: 760px !important;
    margin-bottom: 22px !important;
}

/* Отключаем старые конфликтующие правила карточки товара */
.product-detail-head,
.product-detail-image-box,
.product-detail-photo {
    all: unset;
}

@media (max-width: 900px) {
    .product-page-hero {
        grid-template-columns: 1fr !important;
    }

    .product-page-photo-cell {
        width: 240px !important;
        height: 200px !important;
    }

    .product-page-actions {
        grid-template-columns: 1fr 1fr !important;
        max-width: none !important;
    }

    .product-page-main h1 {
        font-size: 28px !important;
    }
}

@media (max-width: 760px) {
    .product-page-main h1 {
        font-size: 24px !important;
    }

    .product-meta-line {
        font-size: 15px !important;
    }

    .product-page-actions {
        grid-template-columns: 1fr !important;
    }

    .product-page-photo-cell {
        width: 190px !important;
        height: 160px !important;
    }
}


/* ============================================================
   Compact desktop topbar fix
   Desktop: one-line header.
   Mobile: keep collapsible mobile menu.
   ============================================================ */

@media (min-width: 761px) {
    .topbar {
        min-height: 0 !important;
    }

    .topbar-inner {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 22px !important;
        padding: 14px 28px !important;
        min-height: 0 !important;
    }

    .topbar-head {
        display: contents !important;
    }

    .logo {
        grid-column: 1 !important;
        font-size: 28px !important;
        line-height: 1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .desktop-nav {
        grid-column: 2 !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        margin: 0 !important;
    }

    .desktop-nav .nav,
    .desktop-nav .dropdown-toggle {
        min-height: 42px !important;
        padding: 9px 16px !important;
        font-size: 16px !important;
        line-height: 1 !important;
        border-radius: 12px !important;
        white-space: nowrap !important;
    }

    .desktop-nav .nav-dropdown {
        position: relative !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .desktop-nav .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 0 !important;
        min-width: 220px !important;
        z-index: 10000 !important;
    }

    .account-switcher {
        grid-column: 3 !important;
        margin-left: 0 !important;
        width: auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }

    .account-switcher form {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
    }

    .account-switcher label {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    .account-switcher select {
        width: 230px !important;
        min-height: 42px !important;
        font-size: 16px !important;
        margin: 0 !important;
    }

    .mobile-menu {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .topbar-inner {
        padding: 10px 12px !important;
    }
}


/* ============================================================
   Final compact desktop topbar
   Row 1: logo + account
   Row 2: navigation
   ============================================================ */

@media (min-width: 761px) {
    .topbar-inner {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 10px !important;
        padding: 14px 28px 12px !important;
    }

    .topbar-head {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 24px !important;
        width: 100% !important;
    }

    .logo {
        font-size: 26px !important;
        line-height: 1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .account-switcher {
        margin-left: auto !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    .account-switcher form {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
    }

    .account-switcher label {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        font-size: 14px !important;
        font-weight: 800 !important;
    }

    .account-switcher select {
        width: 230px !important;
        min-height: 36px !important;
        height: 36px !important;
        font-size: 15px !important;
        margin: 0 !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    .desktop-nav {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .desktop-nav .nav,
    .desktop-nav .dropdown-toggle {
        min-height: 36px !important;
        height: 36px !important;
        padding: 7px 14px !important;
        font-size: 15px !important;
        line-height: 1 !important;
        border-radius: 11px !important;
        white-space: nowrap !important;
    }

    .desktop-nav .nav-dropdown {
        position: relative !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .desktop-nav .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        min-width: 220px !important;
        z-index: 10000 !important;
    }

    .mobile-menu {
        display: none !important;
    }
}


/* ============================================================
   Clean header: topbar menu + account bar below
   ============================================================ */

@media (min-width: 761px) {
    .topbar-inner.clean-topbar-inner {
        display: flex !important;
        align-items: center !important;
        gap: 26px !important;
        padding: 16px 28px !important;
        min-height: 0 !important;
    }

    .clean-topbar-inner .logo {
        font-size: 26px !important;
        line-height: 1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        flex: 0 0 auto !important;
    }

    .clean-desktop-nav {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        margin: 0 !important;
        width: auto !important;
    }

    .clean-desktop-nav .nav,
    .clean-desktop-nav .dropdown-toggle {
        min-height: 38px !important;
        height: 38px !important;
        padding: 8px 14px !important;
        font-size: 15px !important;
        line-height: 1 !important;
        border-radius: 11px !important;
        white-space: nowrap !important;
    }

    .clean-desktop-nav .nav-dropdown {
        position: relative !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .clean-desktop-nav .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        min-width: 220px !important;
        z-index: 10000 !important;
    }

    .account-bar {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 10px 28px 0 !important;
        background: #f3f4f6 !important;
    }

    .account-bar form {
        margin: 0 !important;
    }

    .account-bar label {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        color: #4b5563 !important;
        white-space: nowrap !important;
    }

    .account-bar select {
        width: 240px !important;
        height: 38px !important;
        min-height: 38px !important;
        margin: 0 !important;
        font-size: 15px !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        color: #111827 !important;
    }

    .mobile-menu {
        display: none !important;
    }

    /* Старый блок выбора кабинета больше не участвует */
    .topbar .account-switcher,
    .topbar-head {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .clean-topbar-inner {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }

    .clean-topbar-inner .logo {
        text-align: center !important;
        font-size: 22px !important;
    }

    .desktop-nav {
        display: none !important;
    }

    .mobile-menu {
        display: block !important;
    }

    .account-bar {
        padding: 8px 12px 0 !important;
        background: #f3f4f6 !important;
    }

    .account-bar form,
    .account-bar label,
    .account-bar select {
        width: 100% !important;
    }

    .account-bar label {
        display: block !important;
        font-weight: 800 !important;
        color: #4b5563 !important;
    }

    .account-bar select {
        margin-top: 5px !important;
        min-height: 42px !important;
        font-size: 16px !important;
        background: #ffffff !important;
        color: #111827 !important;
    }
}


/* ============================================================
   Header cleanup: reports dropdown without border
   ============================================================ */

@media (min-width: 761px) {
    .clean-desktop-nav .nav-dropdown .dropdown-toggle,
    .desktop-nav .nav-dropdown .dropdown-toggle {
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        background: transparent !important;
        color: #d1d5db !important;
    }

    .clean-desktop-nav .nav-dropdown.active .dropdown-toggle,
    .desktop-nav .nav-dropdown.active .dropdown-toggle,
    .clean-desktop-nav .nav-dropdown .dropdown-toggle:hover,
    .desktop-nav .nav-dropdown .dropdown-toggle:hover {
        background: #7c3aed !important;
        color: #ffffff !important;
    }

    .dropdown-arrow {
        opacity: 0.7;
        font-size: 11px;
        margin-left: 4px;
    }
}


/* ============================================================
   Header cleanup: align Reports WB dropdown exactly like nav links
   ============================================================ */

@media (min-width: 761px) {
    .clean-desktop-nav {
        align-items: center !important;
    }

    .clean-desktop-nav .nav,
    .clean-desktop-nav .dropdown-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        vertical-align: middle !important;
        font-family: inherit !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .clean-desktop-nav .nav-dropdown {
        display: inline-flex !important;
        align-items: center !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .clean-desktop-nav .nav-dropdown .dropdown-toggle {
        appearance: none !important;
        -webkit-appearance: none !important;
        border: 0 !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 8px 14px !important;
        transform: translateY(0) !important;
    }

    .clean-desktop-nav .dropdown-arrow {
        display: inline-flex !important;
        align-items: center !important;
        margin-left: 6px !important;
        line-height: 1 !important;
        position: relative !important;
        top: 0 !important;
    }
}


/* ============================================================
   WBHub logo mark
   ============================================================ */

.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.logo-mark {
    width: 38px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.logo-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.logo-text {
    display: inline-block;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -0.03em;
}

@media (min-width: 761px) {
    .clean-topbar-inner .logo-with-mark {
        gap: 10px !important;
    }

    .clean-topbar-inner .logo-mark {
        width: 42px;
        height: 32px;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px;
        line-height: 1;
    }
}

@media (max-width: 760px) {
    .logo-with-mark {
        justify-content: center !important;
    }

    .logo-mark {
        width: 36px;
        height: 28px;
    }

    .logo-text {
        font-size: 22px;
    }
}


/* ============================================================
   WBHub PNG logo
   ============================================================ */

.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.logo-img {
    width: 38px !important;
    height: 38px !important;
    object-fit: contain !important;
    display: block !important;
    flex: 0 0 auto !important;
}

.logo-text {
    display: inline-block !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}

@media (min-width: 761px) {
    .clean-topbar-inner .logo-img {
        width: 42px !important;
        height: 42px !important;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px !important;
    }
}

@media (max-width: 760px) {
    .logo-with-mark {
        justify-content: center !important;
    }

    .logo-img {
        width: 34px !important;
        height: 34px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}


/* Real uploaded WBHub logo */
.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.real-logo-img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain !important;
    display: block !important;
}

.logo-text {
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}

@media (min-width: 761px) {
    .clean-topbar-inner .real-logo-img {
        width: 46px !important;
        height: 46px !important;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px !important;
    }
}

@media (max-width: 760px) {
    .real-logo-img {
        width: 36px !important;
        height: 36px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}


/* ============================================================
   Logo fix: uploaded image contains extra text, show it as compact mark
   ============================================================ */

.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.real-logo-img,
.logo-img {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover !important;
    object-position: left center !important;
    border-radius: 0 !important;
    display: block !important;
}

.logo-text {
    font-size: 28px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    line-height: 1 !important;
    letter-spacing: -0.03em !important;
}

@media (max-width: 760px) {
    .real-logo-img,
    .logo-img {
        width: 34px !important;
        height: 34px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}


/* ============================================================
   Clean WBHub icon logo
   ============================================================ */

.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.real-logo-img,
.logo-img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    flex: 0 0 auto !important;
}

.logo-text {
    display: inline-block !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}

@media (min-width: 761px) {
    .clean-topbar-inner .real-logo-img,
    .clean-topbar-inner .logo-img {
        width: 42px !important;
        height: 42px !important;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px !important;
    }
}

@media (max-width: 760px) {
    .real-logo-img,
    .logo-img {
        width: 34px !important;
        height: 34px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}


/* ============================================================
   Final clean WBHub PNG icon
   ============================================================ */

.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.real-logo-img,
.logo-img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    flex: 0 0 auto !important;
    border: 0 !important;
    background: transparent !important;
}

.logo-text {
    display: inline-block !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}

@media (min-width: 761px) {
    .clean-topbar-inner .real-logo-img,
    .clean-topbar-inner .logo-img {
        width: 44px !important;
        height: 44px !important;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px !important;
    }
}

@media (max-width: 760px) {
    .real-logo-img,
    .logo-img {
        width: 34px !important;
        height: 34px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}


/* Final WBHub logo v2 */
.logo-with-mark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
}

.real-logo-img,
.logo-img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
    display: block !important;
    flex: 0 0 auto !important;
    border: 0 !important;
    background: transparent !important;
}

.logo-text {
    display: inline-block !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}

@media (min-width: 761px) {
    .clean-topbar-inner .real-logo-img,
    .clean-topbar-inner .logo-img {
        width: 42px !important;
        height: 42px !important;
    }

    .clean-topbar-inner .logo-text {
        font-size: 26px !important;
    }
}

@media (max-width: 760px) {
    .real-logo-img,
    .logo-img {
        width: 34px !important;
        height: 34px !important;
    }

    .logo-text {
        font-size: 22px !important;
    }
}

/* Logo final PNG */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img.real-logo-img {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo-text {
    display: inline-block;
}

/* Uploaded logo mark */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img.real-logo-img {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo-text {
    display: inline-block;
}

/* Logo proportions fix */
.logo-img.real-logo-img {
    width: 42px;
    height: auto;
    max-height: 34px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}


/* ============================================================
   Liquid glass login page
   ============================================================ */

.login-body {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.28), transparent 34%),
        radial-gradient(circle at 78% 22%, rgba(14, 165, 233, 0.24), transparent 32%),
        radial-gradient(circle at 50% 90%, rgba(59, 130, 246, 0.18), transparent 34%),
        #07111f;
    color: #f8fafc;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.login-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    isolation: isolate;
}

.login-bg-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

.login-bg-orb-1 {
    width: 420px;
    height: 420px;
    left: -120px;
    top: -90px;
    background: rgba(124, 58, 237, 0.32);
}

.login-bg-orb-2 {
    width: 360px;
    height: 360px;
    right: -80px;
    top: 120px;
    background: rgba(14, 165, 233, 0.28);
}

.login-bg-orb-3 {
    width: 520px;
    height: 520px;
    left: 42%;
    bottom: -260px;
    background: rgba(37, 99, 235, 0.24);
}

.login-blur-table {
    position: absolute;
    inset: 50%;
    width: min(1180px, 92vw);
    height: min(650px, 74vh);
    transform: translate(-50%, -50%) rotate(-2deg);
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
        rgba(255, 255, 255, 0.08);
    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0.72;
    z-index: 1;
    overflow: hidden;
}

.login-blur-table::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 28%, transparent 70%, rgba(255, 255, 255, 0.10)),
        rgba(7, 17, 31, 0.10);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: none;
}

.mock-browser-bar {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.36);
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mock-browser-bar span {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: block;
}

.mock-browser-bar span:nth-child(1) { background: #fb7185; }
.mock-browser-bar span:nth-child(2) { background: #fbbf24; }
.mock-browser-bar span:nth-child(3) { background: #34d399; }

.mock-browser-bar b {
    margin-left: 14px;
}

.mock-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.mock-stats-row div {
    min-height: 74px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.mock-stats-row b {
    display: block;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.mock-stats-row span {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    font-weight: 700;
}

.mock-products-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.78);
}

.mock-products-table th,
.mock-products-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

.mock-products-table th {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 900;
    background: rgba(15, 23, 42, 0.22);
}

.mock-products-table td {
    font-weight: 750;
}

.mock-products-table i {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(14, 165, 233, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.mock-products-table .ok {
    color: #86efac;
}

.mock-products-table .warn {
    color: #fde68a;
}

.login-card {
    width: min(420px, calc(100vw - 40px));
    position: relative;
    z-index: 2;
    padding: 34px;
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.44)),
        rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow:
        0 36px 100px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    color: #0f172a;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 33px;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 40%, rgba(255, 255, 255, 0.22));
    opacity: 0.8;
}

.login-logo-block {
    position: relative;
    text-align: center;
    margin-bottom: 26px;
}

.login-logo-mark-wrap {
    width: 82px;
    height: 82px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.78));
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.login-logo-mark {
    width: 54px;
    height: auto;
    display: block;
    object-fit: contain;
}

.login-logo-text {
    font-size: 44px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.07em;
    color: #0f172a;
}

.login-subtitle {
    margin-top: 10px;
    color: #64748b;
    font-weight: 750;
    font-size: 14px;
    line-height: 1.35;
}

.login-error {
    position: relative;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(254, 226, 226, 0.92);
    color: #991b1b;
    font-weight: 850;
    border: 1px solid rgba(248, 113, 113, 0.28);
}

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

.login-form label {
    display: grid;
    gap: 8px;
}

.login-form label span {
    color: #334155;
    font-size: 14px;
    font-weight: 900;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    height: 54px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.46);
    background: rgba(255, 255, 255, 0.72);
    color: #0f172a;
    font-size: 17px;
    font-weight: 750;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 0 rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input:focus {
    border-color: rgba(124, 58, 237, 0.74);
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 0 0 5px rgba(124, 58, 237, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-form button {
    height: 56px;
    margin-top: 8px;
    border: 0;
    border-radius: 19px;
    background:
        linear-gradient(135deg, #7c3aed, #2563eb 58%, #06b6d4);
    color: #ffffff;
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.02em;
    cursor: pointer;
    box-shadow:
        0 18px 42px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.login-form button:hover {
    transform: translateY(-1px);
    filter: saturate(112%);
    box-shadow:
        0 22px 52px rgba(37, 99, 235, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.login-form button:active {
    transform: translateY(0);
}

.login-footnote {
    position: relative;
    margin-top: 18px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 750;
}

@media (max-width: 760px) {
    .login-shell {
        padding: 20px;
    }

    .login-blur-table {
        width: 1040px;
        height: 620px;
        transform: translate(-50%, -50%) rotate(-6deg) scale(0.78);
        opacity: 0.54;
    }

    .login-card {
        padding: 26px;
        border-radius: 28px;
    }

    .login-logo-text {
        font-size: 38px;
    }

    .login-logo-mark-wrap {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

    .login-logo-mark {
        width: 48px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .login-bg-orb-1 {
        animation: loginFloatOne 12s ease-in-out infinite;
    }

    .login-bg-orb-2 {
        animation: loginFloatTwo 14s ease-in-out infinite;
    }

    .login-bg-orb-3 {
        animation: loginFloatThree 16s ease-in-out infinite;
    }
}

@keyframes loginFloatOne {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(28px, 22px, 0); }
}

@keyframes loginFloatTwo {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-26px, 18px, 0); }
}

@keyframes loginFloatThree {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(18px, -22px, 0); }
}

/* Stronger login background blur / less readable mock table */
.login-blur-table {
    opacity: 0.46 !important;
    filter: blur(3px) saturate(80%) brightness(0.72) !important;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.03) !important;
}

.login-blur-table::after {
    background:
        radial-gradient(circle at center, rgba(7, 17, 31, 0.12), rgba(7, 17, 31, 0.58)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.06)),
        rgba(7, 17, 31, 0.34) !important;
    backdrop-filter: blur(13px) saturate(85%) !important;
    -webkit-backdrop-filter: blur(13px) saturate(85%) !important;
}

.mock-products-table,
.mock-stats-row,
.mock-browser-bar {
    opacity: 0.66 !important;
}

.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 28%),
        linear-gradient(180deg, rgba(7, 17, 31, 0.10), rgba(7, 17, 31, 0.34));
}

.login-card {
    z-index: 3 !important;
}

@media (max-width: 760px) {
    .login-blur-table {
        opacity: 0.34 !important;
        filter: blur(5px) saturate(75%) brightness(0.65) !important;
        transform: translate(-50%, -50%) rotate(-6deg) scale(0.82) !important;
    }
}

/* Login final balance: softer blur + strict form alignment */
.login-blur-table {
    opacity: 0.56 !important;
    filter: blur(1.7px) saturate(88%) brightness(0.78) !important;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.02) !important;
}

.login-blur-table::after {
    background:
        radial-gradient(circle at center, rgba(7, 17, 31, 0.08), rgba(7, 17, 31, 0.42)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 32%, transparent 70%, rgba(255, 255, 255, 0.05)),
        rgba(7, 17, 31, 0.22) !important;
    backdrop-filter: blur(7px) saturate(88%) !important;
    -webkit-backdrop-filter: blur(7px) saturate(88%) !important;
}

.mock-products-table,
.mock-stats-row,
.mock-browser-bar {
    opacity: 0.72 !important;
}

/* Fix login card/form overflow */
.login-card {
    width: min(460px, calc(100vw - 40px)) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 34px !important;
}

.login-card *,
.login-card *::before,
.login-card *::after {
    box-sizing: border-box !important;
}

.login-form {
    width: 100% !important;
    max-width: 100% !important;
}

.login-form label {
    width: 100% !important;
    max-width: 100% !important;
}

.login-form input,
.login-form button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.login-form input {
    display: block !important;
}

.login-form button {
    display: block !important;
}

.login-logo-block,
.login-error,
.login-footnote {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 760px) {
    .login-card {
        width: min(420px, calc(100vw - 28px)) !important;
        padding: 26px !important;
    }

    .login-blur-table {
        opacity: 0.42 !important;
        filter: blur(3px) saturate(82%) brightness(0.72) !important;
        transform: translate(-50%, -50%) rotate(-6deg) scale(0.82) !important;
    }
}

/* Final login background balance: a bit less blur */
.login-blur-table {
    opacity: 0.62 !important;
    filter: blur(1.1px) saturate(92%) brightness(0.82) !important;
}

.login-blur-table::after {
    background:
        radial-gradient(circle at center, rgba(7, 17, 31, 0.06), rgba(7, 17, 31, 0.34)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 32%, transparent 70%, rgba(255, 255, 255, 0.04)),
        rgba(7, 17, 31, 0.16) !important;
    backdrop-filter: blur(5px) saturate(92%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(92%) !important;
}

.mock-products-table,
.mock-stats-row,
.mock-browser-bar {
    opacity: 0.78 !important;
}

@media (max-width: 760px) {
    .login-blur-table {
        opacity: 0.48 !important;
        filter: blur(2.4px) saturate(86%) brightness(0.76) !important;
    }
}

/* Registration and admin users */
.login-success {
    position: relative;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(220, 252, 231, 0.94);
    color: #166534;
    font-weight: 850;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.login-actions-row {
    position: relative;
    margin-top: 16px;
    text-align: center;
}

.login-actions-row a {
    color: #4f46e5;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
}

.login-actions-row a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
}

.badge.ok {
    background: #dcfce7;
    color: #166534;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.actions-cell form {
    margin: 0;
}

.danger-button {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

/* Logout button and audit log */
.logout-link {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.10) !important;
    color: #991b1b !important;
    border: 1px solid rgba(239, 68, 68, 0.18) !important;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 900;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.16) !important;
    text-decoration: none !important;
}

.mono-small {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.audit-details {
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Account dropdown menu */
.top-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.account-menu {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    z-index: 50;
}

.account-menu-button {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.72);
    color: rgba(255, 255, 255, 0.94);
    min-height: 44px;
    padding: 7px 12px 7px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.01em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.16);
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.account-menu-button:hover {
    border-color: rgba(167, 139, 250, 0.65);
    background: rgba(30, 41, 59, 0.86);
    transform: translateY(-1px);
}

.account-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
    color: #fff;
    font-size: 14px;
    font-weight: 1000;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.26);
}

.account-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-caret {
    color: rgba(226, 232, 240, 0.72);
    font-size: 13px;
    margin-left: 2px;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 230px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.account-menu:hover .account-dropdown,
.account-menu:focus-within .account-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.account-dropdown a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.92);
    text-decoration: none;
    font-weight: 850;
    white-space: nowrap;
}

.account-dropdown a:hover {
    background: rgba(124, 58, 237, 0.18);
    color: #fff;
    text-decoration: none;
}

.account-dropdown-separator {
    height: 1px;
    margin: 6px 4px;
    background: rgba(148, 163, 184, 0.18);
}

.account-dropdown .account-logout {
    color: #fecaca;
}

.account-dropdown .account-logout:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fff;
}

/* kill old logout style if it exists */
.logout-link {
    margin-left: 0 !important;
}

@media (max-width: 900px) {
    .account-menu {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .account-name {
        max-width: 120px;
    }

    .account-dropdown {
        right: 0;
    }
}

/* Final clean WBHub header */
.app-header {
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    color: #fff;
}

.header-inner {
    min-height: 118px;
    max-width: 1920px;
    margin: 0 auto;
    padding: 28px 48px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    text-decoration: none;
    color: #fff;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 52px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-size: 36px;
    line-height: 1;
    font-weight: 1000;
    letter-spacing: -0.04em;
    color: #fff;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.main-nav .nav-link,
.nav-dropdown-button {
    height: 52px;
    padding: 0 20px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: rgba(226, 232, 240, 0.84);
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    font-weight: 950;
    white-space: nowrap;
    cursor: pointer;
}

.main-nav .nav-link:hover,
.nav-dropdown-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.main-nav .nav-link.active {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.28);
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 16px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    color: #fff;
    background: rgba(124, 58, 237, 0.18);
    text-decoration: none;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
    z-index: 120;
}

.user-menu-button {
    height: 50px;
    padding: 7px 13px 7px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.74);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 950;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.16);
}

.user-menu-button:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(167, 139, 250, 0.65);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
    color: #fff;
    font-size: 15px;
    font-weight: 1000;
}

.user-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-caret {
    color: rgba(226, 232, 240, 0.72);
    font-size: 13px;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 240px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 16px;
    font-weight: 850;
    text-decoration: none;
}

.user-dropdown a:hover {
    color: #fff;
    background: rgba(124, 58, 237, 0.18);
    text-decoration: none;
}

.user-dropdown a.danger {
    color: #fecaca;
}

.user-dropdown a.danger:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fff;
}

.user-dropdown-separator {
    height: 1px;
    margin: 6px 4px;
    background: rgba(148, 163, 184, 0.18);
}

/* neutralize previous broken account/logout styles */
.account-menu,
.account-dropdown,
.account-menu-button,
.logout-link {
    all: unset;
}

@media (max-width: 1250px) {
    .header-inner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .user-menu {
        margin-left: auto;
    }
}

@media (max-width: 700px) {
    .header-inner {
        padding: 22px 18px;
        gap: 18px;
        min-height: auto;
    }

    .brand-text {
        font-size: 30px;
    }

    .main-nav .nav-link,
    .nav-dropdown-button {
        height: 46px;
        padding: 0 15px;
        font-size: 18px;
    }
}
