:root {
    --portal-font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --portal-bg: #f4f5f7;
    --portal-surface: #ffffff;
    --portal-border: #e5e7eb;
    --portal-text: #272626;
    --portal-muted: #6b7280;
    /* Mavonorm Exhibits brand — https://mavonorm-global.de */
    --portal-primary: #e73b26;
    --portal-primary-hover: #c92f1b;
    --portal-primary-soft: #fff5f3;
    --portal-primary-rgb: 231, 59, 38;
    --portal-secondary: #062b6f;
    --portal-secondary-soft: #eef2f8;
    --portal-accent: #062b6f;
    --portal-success: #10b981;
    --portal-warning: #f59e0b;
    --portal-danger: #ef4444;
    --portal-nav: linear-gradient(180deg, #121212 0%, #062b6f 55%, #0a1f4d 100%);
    --portal-sidebar-width: 260px;
    --portal-sidebar-width-collapsed: 0px;
    --portal-topbar-height: 64px;
    --portal-shadow: 0 1px 3px rgba(18, 18, 18, 0.06), 0 8px 24px rgba(18, 18, 18, 0.06);
    --portal-radius: 12px;
    --portal-radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body.portal-body {
    font-family: var(--portal-font);
    background: var(--portal-bg);
    color: var(--portal-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ——— Two-column app shell ——— */
body.portal-body-app {
    overflow-x: hidden;
}

.portal-app {
    display: flex;
    min-height: 100vh;
}

.portal-main-wrap {
    flex: 1;
    min-width: 0;
    margin-left: var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* Sidebar */
.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: var(--portal-sidebar-width);
    height: 100vh;
    background: var(--portal-nav);
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    transition: transform 0.25s ease;
}

.portal-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #ffffff;
}

.portal-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--portal-text);
    min-width: 0;
}

.portal-brand-logo {
    display: block;
    height: 34px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.portal-sidebar-logo-crm {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--portal-primary);
    line-height: 1;
    white-space: nowrap;
}

.portal-sidebar-close {
    background: transparent;
    border: none;
    color: var(--portal-muted);
    padding: 0.35rem;
    border-radius: 8px;
}

.portal-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.65rem 1rem;
}

.portal-sidebar-section {
    margin-bottom: 0.5rem;
}

.portal-sidebar-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.5rem 0.75rem 0.35rem;
}

.portal-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    margin-bottom: 2px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
}

.portal-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-sidebar-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 3px 0 0 var(--portal-primary);
}

.portal-sidebar-icon {
    display: flex;
    opacity: 0.9;
    flex-shrink: 0;
}

.portal-sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.portal-sidebar-group-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.portal-sidebar-chevron {
    transition: transform 0.2s;
    opacity: 0.7;
}

.portal-sidebar-group-toggle:not(.collapsed) .portal-sidebar-chevron,
.portal-sidebar-group-toggle[aria-expanded="true"] .portal-sidebar-chevron {
    transform: rotate(180deg);
}

.portal-sidebar-subnav {
    padding: 0.15rem 0 0.35rem 0.35rem;
}

.portal-sidebar-sublink {
    display: block;
    padding: 0.45rem 0.75rem 0.45rem 2.25rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 1px;
}

.portal-sidebar-sublink:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.portal-sidebar-sublink.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
}

.portal-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-sidebar-user-mini {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.portal-sidebar-user-avatar,
.portal-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.portal-sidebar-user-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.portal-sidebar-user-role {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.portal-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

/* Top bar */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--portal-topbar-height);
    min-height: var(--portal-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.portal-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.portal-topbar-menu-btn {
    background: var(--portal-primary-soft);
    border: none;
    color: var(--portal-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-topbar-titles {
    min-width: 0;
}

.portal-breadcrumb {
    font-size: 0.75rem;
    color: var(--portal-muted);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-breadcrumb a {
    color: var(--portal-muted);
    text-decoration: none;
}

.portal-breadcrumb a:hover {
    color: var(--portal-primary);
}

.portal-breadcrumb-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.portal-breadcrumb-current {
    color: var(--portal-text);
    font-weight: 500;
}

.portal-topbar-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: transparent;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 0.35rem 0.65rem 0.35rem 0.35rem;
}

.portal-topbar-user::after {
    margin-left: 0.25rem;
}

.portal-topbar-user-text {
    text-align: left;
    line-height: 1.2;
}

.portal-topbar-user-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-topbar-user-email {
    display: block;
    font-size: 0.7rem;
    color: var(--portal-muted);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-topbar-avatar {
    background: var(--portal-primary);
    color: #fff;
}

.portal-topbar-notify {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: var(--portal-surface);
    color: var(--portal-muted);
}

.portal-topbar-notify::after {
    display: none;
}

.portal-topbar-notify:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.portal-topbar-notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--portal-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.portal-notify-dropdown {
    width: min(22rem, 92vw);
    border: none;
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    padding: 0;
    overflow: hidden;
}

.portal-notify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    background: #f8fafc;
    font-size: 0.875rem;
}

.portal-notify-mark-all {
    font-size: 0.75rem;
    text-decoration: none;
}

.portal-notify-item-form {
    margin: 0;
}

.portal-notify-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--portal-border);
    background: var(--portal-surface);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.portal-notify-item:hover {
    background: var(--portal-primary-soft);
}

.portal-notify-item.unread {
    background: #fffbeb;
}

.portal-notify-item-title {
    display: block;
    font-size: 0.8125rem;
    color: var(--portal-text);
    line-height: 1.35;
}

.portal-notify-item-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--portal-muted);
}

.portal-notify-empty {
    padding: 1.25rem 1rem;
    font-size: 0.8125rem;
    color: var(--portal-muted);
    text-align: center;
}

/* Login pending tasks modal */
.portal-pending-modal .modal-content {
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
}

.portal-pending-modal-header {
    padding: 1.35rem 1.5rem 1.25rem;
    background: linear-gradient(135deg, #121212 0%, #062b6f 50%, #e73b26 100%);
    color: #fff;
}

.portal-pending-modal-header .modal-title {
    color: #fff;
}

.portal-pending-modal-header-inner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portal-pending-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.portal-pending-modal-sub {
    font-size: 0.875rem;
    opacity: 0.92;
}

.portal-pending-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.portal-pending-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.portal-pending-stat-urgent {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(252, 165, 165, 0.45);
}

.portal-pending-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.portal-pending-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.9;
    margin-top: 0.15rem;
}

.portal-pending-modal-body {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    max-height: min(55vh, 28rem);
}

.portal-pending-section + .portal-pending-section {
    margin-top: 1.25rem;
}

.portal-pending-section-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.portal-pending-section-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.portal-pending-section-count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.portal-pending-cards {
    display: grid;
    gap: 0.65rem;
}

.portal-pending-card {
    position: relative;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-pending-card:hover {
    border-color: rgba(var(--portal-primary-rgb), 0.35);
    box-shadow: 0 4px 12px rgba(var(--portal-primary-rgb), 0.08);
}

.portal-pending-card-urgent {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}

.portal-pending-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.portal-pending-card-link {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--portal-text);
    text-decoration: none;
}

.portal-pending-card-link:hover {
    color: var(--portal-primary);
}

.portal-pending-card-company {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-muted);
    margin-top: 0.1rem;
}

.portal-pending-urgent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.portal-pending-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    animation: portal-pending-pulse 1.4s ease-in-out infinite;
}

@keyframes portal-pending-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.25); }
}

.portal-pending-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.portal-pending-days {
    font-size: 0.75rem;
}

.portal-pending-card-foot {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--portal-border);
}

.portal-pending-card-action {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-primary);
    text-decoration: none;
}

.portal-pending-card-action:hover {
    text-decoration: underline;
}

.portal-pending-modal-footer {
    padding: 0.85rem 1.5rem 1.25rem;
    background: #fff;
    justify-content: flex-end;
    gap: 0.5rem;
}

.portal-user-dropdown {
    border: none;
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    min-width: 220px;
}

.portal-user-dropdown .dropdown-item {
    font-size: 0.875rem;
}

/* Main content */
.portal-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: auto;
}

.portal-main-guest {
    padding-bottom: 3rem;
}

.portal-main {
    padding-bottom: 3rem;
}

.portal-page-header {
    margin-bottom: 1.5rem;
}

.portal-page-header h1,
.portal-page-header h4 {
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.portal-page-header .subtitle {
    color: var(--portal-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Cards */
.portal-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

.portal-listing-tabs {
    border-bottom: 1px solid var(--portal-border);
    padding: 0.5rem 0.75rem 0;
    gap: 0.15rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    background: #fff;
}

.portal-listing-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--portal-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.7rem;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.portal-listing-tabs .nav-link:hover {
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
    border-bottom-color: transparent;
}

.portal-listing-tabs .nav-link.active {
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
    border-bottom-color: var(--portal-primary);
}

.portal-listing-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(var(--portal-primary-rgb), 0.12);
    color: var(--portal-primary);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.portal-listing-tabs .nav-link.active .portal-listing-tab-count {
    background: var(--portal-primary);
    color: #fff;
}

.portal-listing-controls {
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
}

.portal-listing-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
}

.portal-listing-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
}

.portal-listing-active-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
    font-size: 0.7rem;
    font-weight: 600;
}

.portal-listing-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
}

.portal-listing-filter-row + .portal-listing-filter-row {
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.portal-listing-filter-row-label {
    flex: 0 0 4.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-muted);
}

.portal-listing-filter-scroll {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 0.3rem;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: thin;
}

.portal-listing-filter-scroll::-webkit-scrollbar {
    height: 4px;
}

.portal-listing-filter-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.portal-listing-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    background: #f8fafc;
}

.portal-listing-filters-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-muted);
    white-space: nowrap;
}

.portal-listing-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.portal-listing-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    color: var(--portal-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.portal-listing-filter-chip-admin {
    border-left: 2px solid var(--portal-secondary);
}

.portal-listing-filter-chip-marketing {
    border-left: 2px solid var(--portal-primary);
}

.portal-listing-filter-chip:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.portal-listing-filter-chip.active {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: #fff;
}

.portal-listing-filter-chip.active .portal-listing-filter-role {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.portal-listing-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgba(var(--portal-primary-rgb), 0.12);
    color: var(--portal-primary);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.portal-listing-filter-chip.active .portal-listing-filter-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.portal-listing-filter-role {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
}

.portal-listing-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 12rem;
    min-width: 10rem;
    color: var(--portal-muted);
}

.portal-listing-search .form-control {
    border-radius: 8px;
    font-size: 0.8125rem;
}

.portal-page-header-compact {
    margin-bottom: 0.75rem;
}

.portal-fair-duplicate .lead-link,
.portal-fair-duplicate .portal-fair-name-text {
    color: #b45309;
    font-weight: 600;
}

.portal-fair-dup-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

.portal-lead-group-header {
    background: #f8fafc;
    cursor: pointer;
}

.portal-lead-group-header:hover {
    background: #f1f5f9;
}

.portal-lead-group-header[data-expanded="true"] {
    background: #eef2ff;
}

.portal-lead-group-child {
    background: #fafbfc;
}

.portal-lead-group-child td {
    border-top: 1px dashed var(--portal-border);
}

.portal-lead-option-indent {
    display: inline-block;
    width: 0.5rem;
}

.portal-lead-option-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(var(--portal-primary-rgb), 0.1);
    color: var(--portal-primary);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-lead-group-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 0.25rem;
    padding: 0;
    border: 1px solid var(--portal-border);
    border-radius: 6px;
    background: var(--portal-surface);
    color: var(--portal-muted);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, color 0.15s;
}

.portal-lead-group-toggle:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
}

.portal-lead-group-header[data-expanded="true"] .portal-lead-group-chevron {
    transform: rotate(90deg);
}

.portal-lead-group-chevron {
    transition: transform 0.15s;
}

.portal-table-icon-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

.portal-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: var(--portal-surface);
    color: var(--portal-muted);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.portal-icon-btn:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.portal-icon-btn-primary {
    border-color: rgba(var(--portal-primary-rgb), 0.35);
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.portal-icon-btn-danger:hover {
    border-color: var(--portal-danger);
    color: var(--portal-danger);
    background: #fef2f2;
}

.portal-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--portal-border);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    color: var(--portal-text);
}

.portal-card .card-body {
    padding: 1.25rem;
}

/* Stat cards */
.portal-stat {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--portal-shadow);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.portal-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--portal-primary));
}

.portal-stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--portal-text);
}

.portal-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-muted);
    margin-top: 0.35rem;
}

.portal-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
}

/* Tables */
.portal-table-wrap {
    overflow-x: auto;
}

.table.portal-table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table.portal-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table.portal-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--portal-border);
}

.table.portal-table tbody tr:hover {
    background: #f8fafc;
}

.table.portal-table tbody tr.row-unread {
    background: var(--portal-primary-soft);
}

.table.portal-table tbody tr.row-unread:hover {
    background: #e0e7ff;
}

.table.portal-table a.lead-link {
    font-weight: 600;
    color: var(--portal-primary);
    text-decoration: none;
}

.table.portal-table a.lead-link:hover {
    text-decoration: underline;
}

/* Status badges */
.portal-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-badge-costing { background: #dbeafe; color: #1d4ed8; }
.portal-badge-quoted { background: #fef3c7; color: #b45309; }
.portal-badge-negotiation { background: #fce7f3; color: #be185d; }
.portal-badge-won { background: #d1fae5; color: #047857; }
.portal-badge-ongoing { background: #dbeafe; color: #1d4ed8; }
.portal-badge-default { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn-portal-primary {
    background: var(--portal-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

.btn-portal-primary:hover {
    background: var(--portal-primary-hover);
    color: #fff;
}

.btn-portal-outline {
    background: transparent;
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-portal-outline:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    background: var(--portal-primary-soft);
}

.btn-portal-danger {
    background: transparent;
    border: 1px solid #fecaca;
    color: var(--portal-danger);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-portal-danger:hover {
    background: #fef2f2;
    border-color: var(--portal-danger);
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.portal-table .portal-actions-col {
    min-width: 7.5rem;
    white-space: nowrap;
}

/* Alerts */
.alert.portal-alert-success {
    border: none;
    border-radius: var(--portal-radius);
    background: #ecfdf5;
    color: #047857;
}

.alert.portal-alert-danger {
    border: none;
    border-radius: var(--portal-radius);
    background: #fef2f2;
    color: #b91c1c;
}

/* Detail page */
.portal-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.portal-detail-rows {
    display: flex;
    flex-direction: column;
}

.portal-detail-row {
    display: grid;
    grid-template-columns: minmax(9rem, 11rem) 1fr;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--portal-border);
    align-items: start;
}

.portal-detail-row:last-child {
    border-bottom: none;
}

.portal-detail-row .label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-muted);
    padding-top: 0.15rem;
}

.portal-detail-row .value {
    font-weight: 500;
    font-size: 0.9rem;
    word-break: break-word;
}

@media (max-width: 575.98px) {
    .portal-detail-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.portal-detail-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.portal-detail-item:last-child {
    border-bottom: none;
}

.portal-detail-item .label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-muted);
    margin-bottom: 0.2rem;
}

.portal-detail-item .value {
    font-weight: 500;
    font-size: 0.9rem;
}

.portal-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--portal-muted);
    margin-bottom: 1rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: var(--portal-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(var(--portal-primary-rgb), 0.15);
}

/* Login */
.portal-login-wrap {
    min-height: calc(100vh - 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-login-card {
    max-width: 420px;
    width: 100%;
    border-radius: var(--portal-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
    border: 1px solid var(--portal-border);
    overflow: hidden;
}

.portal-login-card .card-header {
    background: #ffffff;
    color: var(--portal-text);
    text-align: center;
    padding: 1.5rem 1.5rem 1.1rem;
    border: none;
    border-bottom: 3px solid var(--portal-primary);
}

.portal-login-logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 240px;
    margin: 0 auto;
    object-fit: contain;
}

.portal-login-tagline {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--portal-muted);
    letter-spacing: 0.02em;
}

/* Dashboard deadline card */
.portal-card-alert .card-header {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    color: #b91c1c;
    border-bottom-color: #fecaca;
}

/* Empty state */
.portal-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--portal-muted);
}

/* Desktop sidebar minimize */
@media (min-width: 992px) {
    html.portal-sidebar-minimized .portal-sidebar,
    body.portal-sidebar-minimized .portal-sidebar {
        transform: translateX(-100%);
    }

    html.portal-sidebar-minimized .portal-main-wrap,
    body.portal-sidebar-minimized .portal-main-wrap {
        margin-left: var(--portal-sidebar-width-collapsed);
    }
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .portal-main-wrap {
        margin-left: 0;
    }

    .portal-sidebar {
        transform: translateX(-100%);
    }

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

    body.portal-sidebar-open .portal-sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .portal-topbar-title {
        font-size: 1rem;
    }

    .portal-content {
        padding: 1rem;
    }
}

/* Bootstrap cards site-wide */
body.portal-body .card {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
}

body.portal-body .card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--portal-border);
    font-weight: 600;
}

body.portal-body .btn-primary {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
}

body.portal-body .btn-primary:hover {
    background: var(--portal-primary-hover);
    border-color: var(--portal-primary-hover);
}

body.portal-body .table thead th {
    color: var(--portal-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

