/* Partner Portal - Design System */
/* Forked from CRP Modern UI with portal-specific additions */

/* ============================================
   CSS VARIABLES & THEME SYSTEM
   ============================================ */
:root {
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #f0f3f6;
    --bg-elevated: #ffffff;
    --bg-canvas: #f6f8fa;

    /* Borders */
    --border-default: #d0d7de;
    --border-muted: #d8dee4;
    --border-subtle: #eaeef2;

    /* Text */
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-tertiary: #8c959f;
    --text-link: #0969da;

    /* Accent colors */
    --accent-primary: #0969da;
    --accent-primary-hover: #0860c4;
    --accent-success: #1a7f37;
    --accent-success-bg: #dafbe1;
    --accent-warning: #bf8700;
    --accent-warning-bg: #fff8c5;
    --accent-danger: #d1242f;
    --accent-danger-bg: #ffebe9;
    --accent-info: #0969da;
    --accent-info-bg: #ddf4ff;
    --accent-purple: #8250df;

    /* Shadows */
    --shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
    --shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
    --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
    --shadow-xl: 0 12px 28px rgba(140, 149, 159, 0.3);

    /* Transitions */
    --transition-fast: 80ms cubic-bezier(0.33, 1, 0.68, 1);
    --transition-base: 150ms cubic-bezier(0.33, 1, 0.68, 1);
    --transition-slow: 250ms cubic-bezier(0.33, 1, 0.68, 1);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   HEADER & NAVIGATION (Partner View)
   ============================================ */
.navbar-portal {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-3) var(--space-4);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-portal .navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.navbar-portal .logo {
    height: 32px;
    width: auto;
}

.navbar-portal .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-portal .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.navbar-portal .nav-link.active {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-tertiary);
}

/* ============================================
   PARTNER SIDEBAR LAYOUT
   ============================================ */
.partner-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.partner-sidebar {
    width: 200px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-default);
    flex-shrink: 0;
    overflow-y: auto;
    padding: var(--space-3) 0;
}

.partner-sidebar-nav {
    display: flex;
    flex-direction: column;
}

.partner-nav-link {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.partner-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.partner-nav-link.active {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
}

.partner-content {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* ============================================
   ADMIN SIDEBAR LAYOUT
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    overflow-y: auto;
    transition: width var(--transition-base);
}

.admin-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
    text-decoration: none;
    color: var(--text-primary);
}

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

.admin-sidebar .sidebar-brand-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.admin-sidebar .sidebar-brand-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-3);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: var(--space-4);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--accent-primary);
    background: var(--accent-info-bg);
    font-weight: 600;
}

.sidebar-link .sidebar-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .sidebar-badge {
    margin-left: auto;
    background: var(--accent-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.sidebar-sub-links {
    padding-left: 32px;
}

.sidebar-sub-links .sidebar-link {
    font-size: 13px;
    padding: var(--space-1) var(--space-3);
}

.sidebar-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-default);
}

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
}

.page-header {
    margin-bottom: var(--space-5);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-1) 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    font-weight: 600;
    font-size: 14px;
}

.card-body {
    padding: var(--space-4);
}

.card-footer {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

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

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: var(--space-3);
    background: var(--stat-color-bg, var(--accent-info-bg));
    color: var(--stat-color, var(--accent-primary));
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.stat-card.stat-primary {
    --stat-color: var(--accent-primary);
    --stat-color-bg: var(--accent-info-bg);
}

.stat-card.stat-warning {
    --stat-color: var(--accent-warning);
    --stat-color-bg: var(--accent-warning-bg);
}

.stat-card.stat-success {
    --stat-color: var(--accent-success);
    --stat-color-bg: var(--accent-success-bg);
}

.stat-card.stat-danger {
    --stat-color: var(--accent-danger);
    --stat-color-bg: var(--accent-danger-bg);
}

.stat-card.stat-info {
    --stat-color: #0891b2;
    --stat-color-bg: rgba(8, 145, 178, 0.1);
}

.stat-card.stat-purple {
    --stat-color: var(--accent-purple);
    --stat-color-bg: rgba(130, 80, 223, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

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

.btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-muted);
}

.btn-success {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-danger {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

.btn-sm {
    padding: 3px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 16px;
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
    display: block;
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.form-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23656d76' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 12px;
    padding-right: 32px;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead th {
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    text-align: left;
}

.table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   ALERTS & BANNERS
   ============================================ */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 14px;
}

.alert-success {
    background: var(--accent-success-bg);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.alert-warning {
    background: var(--accent-warning-bg);
    border-color: var(--accent-warning);
    color: #92400e;
}

.alert-danger {
    background: var(--accent-danger-bg);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.alert-info {
    background: var(--accent-info-bg);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.badge-success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.badge-warning {
    background: var(--accent-warning-bg);
    color: #92400e;
}

.badge-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Partner type badges */
.badge-role {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-role-vendor {
    background: #da3633;
    color: #fff;
}

.badge-role-distributor {
    background: #8250df;
    color: #fff;
}

.badge-role-msp {
    background: #1f6feb;
    color: #fff;
}

.badge-role-var {
    background: #0891b2;
    color: #fff;
}

.badge-role-reseller {
    background: #6e7681;
    color: #fff;
}

/* Tier badges */
.badge-tier-bronze {
    background: #cd7f32;
    color: #fff;
}

.badge-tier-silver {
    background: #c0c0c0;
    color: #333;
}

.badge-tier-gold {
    background: #ffd700;
    color: #333;
}

.badge-tier-platinum {
    background: #e5e4e2;
    color: #333;
    border: 1px solid #c0c0c0;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Partner statuses */
.status-applied {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.status-approved {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-active {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.status-suspended {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.status-terminated {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-inactive {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Deal statuses */
.status-draft {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-submitted {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.status-approved {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-quoted {
    background: rgba(130, 80, 223, 0.1);
    color: var(--accent-purple);
}

.status-po_received {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

.status-ordered {
    background: rgba(8, 145, 178, 0.15);
    color: #0e7490;
}

.status-completed {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.status-rejected {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.status-lost {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.status-expired {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* Invoice statuses */
.status-sent {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.status-paid {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.status-overdue {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.status-cancelled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Transfer statuses */
.status-requested {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-rejected {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.status-completed {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

/* Enrollment statuses */
.status-enrolled {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.status-in_progress {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-failed {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

/* Contract statuses */
.status-expiring-soon {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-expiring_soon {
    background: var(--accent-warning-bg);
    color: #b45309;
}

.status-renewed {
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

/* Customer statuses (reusing active/inactive above) */

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-6);
}

.empty-state .empty-icon {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.empty-state .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state .empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ============================================
   FOOTER
   ============================================ */
.footer-portal {
    text-align: center;
    padding: var(--space-4);
    color: var(--text-tertiary);
    font-size: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-6);
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */
.dropdown-menu {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) 0;
    min-width: 200px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-2) 0;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */
.lang-selector {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.lang-btn {
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.lang-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* ============================================
   PUBLIC (AUTH) LAYOUT
   ============================================ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-4);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary);
}

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

.auth-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.auth-brand-title {
    font-weight: 700;
    line-height: 1.1;
}

.auth-brand-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
}

.auth-main {
    flex: 1;
    display: grid;
    place-items: center;
}

.auth-footer {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ============================================
   USER MENU
   ============================================ */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu-btn:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #40c463, #30a14e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   NOTIFICATION BELL
   ============================================ */
.notification-bell {
    position: relative;
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.notification-bell:hover {
    color: var(--text-primary);
}

.notification-bell .badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 16px;
    text-align: center;
    line-height: 14px;
}

/* ============================================
   PARTNER FINDER (PUBLIC)
   ============================================ */
.partner-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all var(--transition-base);
}

.partner-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.partner-card .partner-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.partner-card .partner-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.partner-card .partner-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-muted);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.quick-action-btn .action-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--accent-info-bg);
    color: var(--accent-primary);
}

.quick-action-btn .action-text {
    flex: 1;
}

.quick-action-btn .action-title {
    font-weight: 600;
    font-size: 14px;
}

.quick-action-btn .action-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   INFO GRID
   ============================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-portal {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-5);
}

.pagination-portal .page-link {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.pagination-portal .page-link:hover {
    background: var(--bg-tertiary);
    text-decoration: none;
}

.pagination-portal .page-link.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* ============================================
   MAX-WIDTH UTILITIES
   ============================================ */
.mw-md {
    max-width: 28rem;
}

.mw-lg {
    max-width: 32rem;
}

.mw-2xl {
    max-width: 42rem;
}

.mw-3xl {
    max-width: 48rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-small {
    font-size: 12px;
}

.text-mono {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .page-container {
        padding: var(--space-4) var(--space-3);
    }

    .navbar-portal {
        padding: var(--space-2) var(--space-3);
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

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

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

    .admin-content {
        margin-left: 0;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   RISK CALCULATOR
   ============================================ */
.risk-gauge {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 0 auto var(--space-4);
}

.risk-gauge-fill {
    width: 200px;
    height: 100px;
    border-radius: 100px 100px 0 0;
    background: linear-gradient(90deg, var(--accent-success) 0%, var(--accent-warning-bg) 33%, #f59e0b 66%, var(--accent-danger) 100%);
    position: relative;
    overflow: hidden;
}

.risk-gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 90px;
    background: var(--text-primary);
    transform-origin: bottom center;
    border-radius: 2px;
    margin-left: -2px;
    transition: transform var(--transition-slow);
}

.risk-score {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
}

.risk-label {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.risk-low {
    color: var(--accent-success);
}

.risk-medium {
    color: var(--accent-warning);
}

.risk-high {
    color: #f59e0b;
}

.risk-critical {
    color: var(--accent-danger);
}

.risk-slider {
    width: 100%;
}

.risk-slider::-webkit-slider-thumb {
    cursor: pointer;
}

/* ============================================
   FINANCIAL CHARTS
   ============================================ */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    padding: var(--space-3);
}

.chart-container canvas {
    max-width: 100%;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.year-selector select {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

/* ============================================
   EXAM UI
   ============================================ */
.exam-container {
    max-width: 720px;
    margin: 0 auto;
}

.exam-timer {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-elevated);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.exam-timer-value {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.exam-timer-warning {
    color: var(--accent-danger);
}

.exam-question-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.exam-question-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
}

.exam-question-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.exam-answer {
    display: block;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.exam-answer:hover {
    border-color: var(--accent-primary);
    background: var(--accent-info-bg);
}

.exam-answer.selected {
    border-color: var(--accent-primary);
    background: var(--accent-info-bg);
    font-weight: 500;
}

.exam-nav {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.exam-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.exam-nav-btn.answered {
    background: var(--accent-success-bg);
    border-color: var(--accent-success);
}

.exam-nav-btn.current {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-info-bg);
}

/* ============================================
   VENDOR CHECKLIST
   ============================================ */
.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.checklist-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
}

.checklist-done {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.checklist-pending {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.checklist-label {
    flex: 1;
    font-size: 14px;
}

/* ============================================
   PRODUCT SPECS
   ============================================ */
.spec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.product-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    transition: box-shadow var(--transition-fast);
}

.product-card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================
   MESSAGE INBOX
   ============================================ */
.message-list {
    display: flex;
    flex-direction: column;
}

.message-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
}

.message-row:hover {
    background: var(--bg-secondary);
    text-decoration: none;
    color: inherit;
}

.message-unread {
    background: var(--accent-info-bg);
    font-weight: 600;
}

.message-unread:hover {
    background: #c8ecff;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.message-unread .message-avatar {
    background: var(--accent-info);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.message-sender {
    font-size: 13px;
    font-weight: 600;
}

.message-subject {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-preview {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.message-meta {
    flex-shrink: 0;
    text-align: right;
}

.message-date {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.message-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.message-type-upsell {
    color: #8250df;
    background: #f3e8ff;
}

.message-type-cross_sell {
    color: #0969da;
    background: #ddf4ff;
}

.message-type-alert {
    color: #bf8700;
    background: #fff8c5;
}

.message-type-system {
    color: #656d76;
    background: #f0f3f6;
}

/* ============================================
   CATEGORY FILTER
   ============================================ */
.category-filter {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.category-filter .btn {
    font-size: 13px;
    padding: var(--space-1) var(--space-3);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar-portal, .admin-sidebar, .footer-portal {
        display: none;
    }

    .admin-content {
        margin-left: 0;
    }

    .page-container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
