/* SAM Portal - Material UI / Tailwind Inspired */

#agr-discount-confirm { visibility: hidden; }
#agr-discount-confirm.visible { visibility: visible; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sam-primary:       #1976d2;
    --sam-primary-dark:  #1565c0;
    --sam-primary-light: #e3f2fd;
    --sam-success:       #2e7d32;
    --sam-success-light: #e8f5e9;
    --sam-warning:       #e65100;
    --sam-warning-light: #fff3e0;
    --sam-danger:        #c62828;
    --sam-danger-light:  #ffebee;
    --sam-purple:        #6a1b9a;
    --sam-purple-light:  #f3e5f5;
    --sam-grey-50:       #fafafa;
    --sam-grey-100:      #f5f5f5;
    --sam-grey-200:      #eeeeee;
    --sam-grey-300:      #e0e0e0;
    --sam-grey-500:      #9e9e9e;
    --sam-grey-700:      #616161;
    --sam-grey-900:      #212121;
    --sam-white:         #ffffff;
    --sam-shadow-sm:     0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
    --sam-shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --sam-shadow-lg:     0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
    --sam-radius:        8px;
    --sam-radius-sm:     4px;
    --sam-radius-lg:     12px;
    --sam-nav-h:         64px;
    --sam-font:          'Roboto', -apple-system, sans-serif;
}

/* ── Layout ────────────────────────────────────────────── */
.sam-portal-wrap {
    font-family: var(--sam-font);
    font-size: 14px;
    color: var(--sam-grey-900);
    background: var(--sam-grey-100);
    min-height: 100vh;
}

/* ── Nav ───────────────────────────────────────────────── */
.sam-portal-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--sam-nav-h);
    background: var(--sam-primary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.sam-nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.sam-nav-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    opacity: .92;
    transition: opacity .2s;
}
.sam-nav-brand-link:hover { opacity: 1; }
.sam-nav-brand-logo {
    height: 70px;
    width: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}

/* Sponsor Forge portal footer */
.sam-portal-footer {
    margin-top: 2.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sam-grey-200, #e5e7eb);
    text-align: center;
}
.sam-portal-footer-link {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--sam-grey-400, #9ca3af);
    transition: color .2s;
}
.sam-portal-footer-link:hover { color: var(--sam-grey-600, #4b5563); }
.sam-portal-footer-powered {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--sam-grey-400, #9ca3af);
}
.sam-portal-footer-logo {
    height: 56px;
    width: auto;
    opacity: .85;
    transition: opacity .2s;
    vertical-align: middle;
}
.sam-portal-footer-link:hover .sam-portal-footer-logo { opacity: 1; }
.sam-portal-footer-tagline {
    font-size: .72rem;
    font-style: italic;
    color: var(--sam-grey-400, #9ca3af);
}

.sam-nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.sam-nav-link {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--sam-radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all .15s;
}
.sam-nav-link:hover  { color: #fff; background: rgba(255,255,255,.12); }
.sam-nav-link.active { color: #fff; background: rgba(255,255,255,.2); }

.sam-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.sam-user-name  { color: rgba(255,255,255,.9); font-size: 13px; }
.sam-user-role  { color: rgba(255,255,255,.6); font-size: 11px; display: block; }

.sam-user-info  { display: flex; flex-direction: column; line-height: 1.2; }

.sam-user-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.25);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.sam-user-avatar--sm { width: 32px; height: 32px; font-size: 13px; background: var(--sam-primary-light); color: var(--sam-primary); }

.sam-logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.7);
    padding: 6px;
    border-radius: var(--sam-radius-sm);
    display: flex;
    align-items: center;
    transition: all .15s;
}
.sam-logout-btn:hover { color: #fff; background: rgba(255,255,255,.15); }
.sam-logout-btn svg   { width: 18px; height: 18px; }

/* ── Page Header ───────────────────────────────────────── */
.sam-portal-header {
    background: var(--sam-white);
    border-bottom: 1px solid var(--sam-grey-200);
    padding: 24px max(32px, calc(50% - 608px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.sam-portal-header h1 { font-size: 22px; font-weight: 500; color: var(--sam-grey-900); margin-bottom: 2px; }
.sam-portal-header p  { font-size: 14px; color: var(--sam-grey-500); margin: 0; }

/* ── Content ───────────────────────────────────────────── */
.sam-portal-content {
    padding: 24px 32px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ── Stats Grid ────────────────────────────────────────── */
.sam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sam-stat-card {
    background: var(--sam-white);
    border-radius: var(--sam-radius);
    box-shadow: var(--sam-shadow-sm);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--sam-grey-200);
    transition: box-shadow .2s;
}
.sam-stat-card:hover { box-shadow: var(--sam-shadow-md); }

.sam-stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--sam-radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sam-stat-icon svg { width: 22px; height: 22px; }
.sam-stat-icon--blue   { background: var(--sam-primary-light); color: var(--sam-primary); }
.sam-stat-icon--green  { background: var(--sam-success-light); color: var(--sam-success); }
.sam-stat-icon--orange { background: var(--sam-warning-light); color: var(--sam-warning); }
.sam-stat-icon--purple { background: var(--sam-purple-light);  color: var(--sam-purple); }

.sam-stat-body { display: flex; flex-direction: column; }
.sam-stat-number { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--sam-grey-900); }
.sam-stat-label  { font-size: 13px; color: var(--sam-grey-500); margin-top: 2px; }
.sam-stat-sub    { font-size: 11px; color: var(--sam-grey-400); margin-top: 3px; }

/* ── Two-col Grid ──────────────────────────────────────── */
.sam-portal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* ── Card ──────────────────────────────────────────────── */
.sam-portal-card {
    background: var(--sam-white);
    border-radius: var(--sam-radius);
    box-shadow: var(--sam-shadow-sm);
    border: 1px solid var(--sam-grey-200);
    overflow: hidden;
}
.sam-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sam-grey-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sam-card-header h3 { font-size: 15px; font-weight: 500; color: var(--sam-grey-900); margin: 0; }
.sam-card-body      { padding: 20px; }

/* ── Buttons ───────────────────────────────────────────── */
.sam-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--sam-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    font-family: var(--sam-font);
    line-height: 1;
    white-space: nowrap;
}
.sam-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.sam-btn-primary {
    background: var(--sam-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(25,118,210,.3);
}
.sam-btn-primary:hover { background: var(--sam-primary-dark); box-shadow: 0 4px 8px rgba(25,118,210,.35); color: #fff; }

.sam-btn-outline {
    background: transparent;
    color: var(--sam-primary);
    border: 1.5px solid var(--sam-primary);
}
.sam-btn-outline:hover { background: var(--sam-primary-light); }

.sam-btn-danger  { background: var(--sam-danger); color: #fff; }
.sam-btn-danger:hover { background: #b71c1c; color: #fff; }

.sam-btn-full { width: 100%; justify-content: center; }

.sam-btn-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--sam-radius-sm);
    border: none; cursor: pointer; background: transparent;
    transition: all .15s;
    text-decoration: none;
}
.sam-btn-icon svg { width: 15px; height: 15px; }
.sam-btn-icon--blue { color: var(--sam-primary); }
.sam-btn-icon--blue:hover { background: var(--sam-primary-light); }
.sam-btn-icon--red  { color: var(--sam-danger); }
.sam-btn-icon--red:hover  { background: var(--sam-danger-light); }

/* ── Forms ─────────────────────────────────────────────── */
.sam-field-group { margin-bottom: 16px; }
.sam-field-group:last-child { margin-bottom: 0; }

.sam-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--sam-grey-700);
    margin-bottom: 6px;
}
.sam-required { color: var(--sam-danger); }

.sam-input-wrap { position: relative; }
.sam-input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--sam-grey-500); pointer-events: none;
}

.sam-input, .sam-select, .sam-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--sam-grey-300);
    border-radius: var(--sam-radius-sm);
    font-size: 14px;
    font-family: var(--sam-font);
    color: var(--sam-grey-900);
    background: var(--sam-white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    appearance: none;
}
.sam-input-wrap .sam-input  { padding-left: 40px; }
.sam-input:focus, .sam-select:focus, .sam-textarea:focus {
    border-color: var(--sam-primary);
    box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}
.sam-textarea   { resize: vertical; min-height: 100px; }
.sam-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; cursor: pointer; }
.sam-select--sm { padding: 5px 30px 5px 8px; font-size: 13px; }
.sam-field-hint { font-size: 12px; color: var(--sam-grey-500); margin-top: 4px; display: block; }

.sam-field-row   { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sam-field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.sam-toggle-password {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--sam-grey-500);
    padding: 2px;
}
.sam-toggle-password svg { width: 16px; height: 16px; }

/* ── Checkbox ──────────────────────────────────────────── */
.sam-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px; color: var(--sam-grey-700);
    user-select: none;
}
.sam-checkbox-label input[type="checkbox"] { display: none; }
.sam-checkmark {
    width: 18px; height: 18px;
    border: 2px solid var(--sam-grey-300);
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}
.sam-checkbox-label input[type="checkbox"]:checked ~ .sam-checkmark {
    background: var(--sam-primary);
    border-color: var(--sam-primary);
}
.sam-checkbox-label input[type="checkbox"]:checked ~ .sam-checkmark::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ── Login ─────────────────────────────────────────────── */
.sam-login-wrap {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #1e88e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.sam-login-card {
    background: var(--sam-white);
    border-radius: var(--sam-radius-lg);
    box-shadow: var(--sam-shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.sam-login-logo { text-align: center; margin-bottom: 32px; }
.sam-login-icon {
    width: 56px; height: 56px;
    background: var(--sam-primary-light);
    color: var(--sam-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.sam-login-icon svg      { width: 28px; height: 28px; }
.sam-login-title         { font-size: 22px; font-weight: 600; color: var(--sam-grey-900); margin-bottom: 6px; }
.sam-login-subtitle      { font-size: 14px; color: var(--sam-grey-500); }
.sam-login-form          { display: flex; flex-direction: column; gap: 0; }

/* ── Alert ─────────────────────────────────────────────── */
.sam-alert {
    padding: 12px 16px;
    border-radius: var(--sam-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sam-alert--error   { background: var(--sam-danger-light);  color: var(--sam-danger);  border-left: 3px solid var(--sam-danger); }
.sam-alert--success { background: var(--sam-success-light); color: var(--sam-success); border-left: 3px solid var(--sam-success); }
.sam-alert--info    { background: var(--sam-primary-light); color: var(--sam-primary); border-left: 3px solid var(--sam-primary); }

/* ── Badges ────────────────────────────────────────────── */
.sam-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.sam-badge--green  { background: var(--sam-success-light); color: var(--sam-success); }
.sam-badge--orange { background: var(--sam-warning-light); color: var(--sam-warning); }
.sam-badge--blue   { background: var(--sam-primary-light); color: var(--sam-primary); }

.sam-badge-toggle { border: none; cursor: pointer; font-family: var(--sam-font); transition: opacity .15s; }
.sam-badge-toggle:hover { opacity: .75; }

/* ── Spinner ───────────────────────────────────────────── */
.sam-spinner { width: 18px; height: 18px; animation: sam-spin 0.8s linear infinite; }
@keyframes sam-spin { to { transform: rotate(360deg); } }

/* ── Link ──────────────────────────────────────────────── */
.sam-link    { color: var(--sam-primary); text-decoration: none; font-size: 13px; }
.sam-link:hover { text-decoration: underline; }
.sam-link-sm { color: var(--sam-primary); text-decoration: none; font-size: 13px; font-weight: 500; }

/* ── Table ─────────────────────────────────────────────── */
.sam-table-wrap { overflow-x: auto; }
.sam-table { width: 100%; border-collapse: collapse; }
.sam-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sam-grey-500);
    border-bottom: 2px solid var(--sam-grey-200);
    background: var(--sam-grey-50);
}
.sam-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sam-grey-100);
    vertical-align: middle;
}
.sam-table tbody tr:hover td { background: var(--sam-grey-50); }
.sam-table tbody tr:last-child td { border-bottom: none; }

.sam-table-asset, .sam-table-user {
    display: flex; align-items: center; gap: 10px;
}
.sam-table-thumb {
    width: 40px; height: 40px;
    border-radius: var(--sam-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.sam-table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sam-table-thumb--placeholder {
    background: var(--sam-grey-100);
    display: flex; align-items: center; justify-content: center;
    color: var(--sam-grey-300);
}
.sam-table-thumb--placeholder svg { width: 18px; height: 18px; }
.sam-table-title  { font-weight: 500; }
.sam-table-actions { display: flex; gap: 4px; }

.sam-text-muted { color: var(--sam-grey-500); }

/* ── Filters ───────────────────────────────────────────── */
.sam-filters-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.sam-filters-bar .sam-input-wrap { flex: 1; min-width: 200px; max-width: 320px; }
.sam-filter-tabs { display: flex; gap: 4px; }
.sam-filter-tab {
    padding: 7px 14px;
    border-radius: var(--sam-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--sam-grey-700);
    text-decoration: none;
    transition: all .15s;
}
.sam-filter-tab:hover  { background: var(--sam-grey-200); color: var(--sam-grey-900); }
.sam-filter-tab.active { background: var(--sam-primary); color: #fff; }

/* ── Pagination ────────────────────────────────────────── */
.sam-pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--sam-grey-200);
    display: flex;
    gap: 4px;
    justify-content: center;
}
.sam-pagination .page-numbers {
    padding: 6px 12px;
    border-radius: var(--sam-radius-sm);
    text-decoration: none;
    font-size: 13px;
    color: var(--sam-grey-700);
    transition: all .15s;
}
.sam-pagination .page-numbers:hover    { background: var(--sam-grey-100); }
.sam-pagination .page-numbers.current  { background: var(--sam-primary); color: #fff; }

/* ── Asset Form ────────────────────────────────────────── */
.sam-form-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}
.sam-form-main    { display: flex; flex-direction: column; gap: 20px; }
.sam-form-sidebar { display: flex; flex-direction: column; gap: 16px; }

.sam-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--sam-grey-500);
    margin-bottom: 4px;
}
.sam-breadcrumb a   { color: var(--sam-primary); text-decoration: none; }
.sam-breadcrumb svg { width: 14px; height: 14px; }

.sam-header-actions { display: flex; gap: 8px; }

/* ── Price Preview ─────────────────────────────────────── */
.sam-price-preview {
    background: var(--sam-grey-50);
    border: 1px solid var(--sam-grey-200);
    border-radius: var(--sam-radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
}
.sam-price-preview-row {
    display: flex; justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: var(--sam-grey-700);
}
.sam-price-preview-total {
    font-weight: 600;
    font-size: 14px;
    color: var(--sam-grey-900);
    border-top: 1px solid var(--sam-grey-200);
    padding-top: 8px;
    margin-top: 4px;
}

/* ── Image Upload ──────────────────────────────────────── */
.sam-image-upload { display: flex; flex-direction: column; gap: 10px; }
.sam-image-preview { position: relative; border-radius: var(--sam-radius-sm); overflow: hidden; }
.sam-image-preview img { width: 100%; height: 180px; object-fit: cover; display: block; }
.sam-image-remove {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,.6); color: #fff;
    border: none; border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.sam-image-placeholder {
    background: var(--sam-grey-100);
    border: 2px dashed var(--sam-grey-300);
    border-radius: var(--sam-radius-sm);
    height: 140px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; color: var(--sam-grey-400);
    font-size: 13px;
}
.sam-image-placeholder svg { width: 32px; height: 32px; }

/* ── Empty State ───────────────────────────────────────── */
.sam-empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 32px; text-align: center; gap: 10px;
    color: var(--sam-grey-500);
}
.sam-empty-state svg       { width: 40px; height: 40px; color: var(--sam-grey-300); }
.sam-empty-state p         { margin: 0; font-size: 14px; }
.sam-empty-state--large    { padding: 56px; }
.sam-empty-state--large svg { width: 56px; height: 56px; }
.sam-empty-state--large h3  { font-size: 18px; font-weight: 500; color: var(--sam-grey-700); margin: 0; }

/* ── Asset List Mini ───────────────────────────────────── */
.sam-asset-list-mini    { list-style: none; display: flex; flex-direction: column; }
.sam-asset-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--sam-grey-100);
}
.sam-asset-list-item:last-child { border-bottom: none; }
.sam-asset-thumb {
    width: 44px; height: 44px;
    border-radius: var(--sam-radius-sm); overflow: hidden; flex-shrink: 0;
}
.sam-asset-thumb img           { width: 100%; height: 100%; object-fit: cover; }
.sam-asset-thumb--placeholder  { background: var(--sam-grey-100); display: flex; align-items: center; justify-content: center; color: var(--sam-grey-300); }
.sam-asset-thumb--placeholder svg { width: 18px; height: 18px; }
.sam-asset-info                { flex: 1; min-width: 0; }
.sam-asset-name                { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sam-asset-meta                { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sam-grey-500); margin-top: 2px; }

/* ── Quick Actions ─────────────────────────────────────── */
.sam-quick-actions { display: flex; flex-direction: column; gap: 4px; }
.sam-quick-action {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    border-radius: var(--sam-radius-sm);
    text-decoration: none;
    color: var(--sam-grey-900);
    transition: background .15s;
}
.sam-quick-action:hover { background: var(--sam-grey-50); }
.sam-qa-icon {
    width: 40px; height: 40px; border-radius: var(--sam-radius);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sam-qa-icon svg { width: 18px; height: 18px; }
.sam-qa-icon--blue   { background: var(--sam-primary-light); color: var(--sam-primary); }
.sam-qa-icon--green  { background: var(--sam-success-light); color: var(--sam-success); }
.sam-qa-icon--purple { background: var(--sam-purple-light);  color: var(--sam-purple); }
.sam-qa-icon--grey   { background: var(--sam-grey-100);      color: var(--sam-grey-700); }
.sam-qa-text         { display: flex; flex-direction: column; }
.sam-qa-title        { font-weight: 500; font-size: 14px; }
.sam-qa-desc         { font-size: 12px; color: var(--sam-grey-500); }

/* ── User Management ───────────────────────────────────── */
.sam-allocate-form {
    display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
}
.sam-allocate-form .sam-input-wrap { flex: 1; min-width: 200px; position: relative; }
.sam-allocate-form .sam-select     { min-width: 150px; }

.sam-search-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: var(--sam-white);
    border: 1.5px solid var(--sam-grey-300);
    border-radius: var(--sam-radius-sm);
    box-shadow: var(--sam-shadow-md);
    max-height: 240px; overflow-y: auto;
}
.sam-search-result {
    padding: 10px 14px; cursor: pointer;
    display: flex; flex-direction: column; gap: 2px;
    border-bottom: 1px solid var(--sam-grey-100);
    transition: background .1s;
}
.sam-search-result:last-child { border-bottom: none; }
.sam-search-result:hover  { background: var(--sam-grey-50); }
.sam-search-result-name   { font-weight: 500; font-size: 14px; }
.sam-search-result-email  { font-size: 12px; color: var(--sam-grey-500); }
.sam-search-result-badge  { font-size: 11px; color: var(--sam-success); font-weight: 500; }

.sam-selected-user { margin-top: 10px; }
.sam-user-chip {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--sam-primary-light);
    border: 1px solid rgba(25,118,210,.2);
    border-radius: 100px;
    padding: 6px 12px;
}
.sam-user-chip .sam-user-avatar { background: var(--sam-primary); color: #fff; }
.sam-user-chip-info { display: flex; flex-direction: column; line-height: 1.2; }
.sam-user-chip-info span { font-size: 13px; }
.sam-chip-close {
    background: none; border: none; cursor: pointer;
    color: var(--sam-grey-500); font-size: 18px; line-height: 1;
    padding: 0 2px; margin-left: 4px;
    transition: color .15s;
}
.sam-chip-close:hover { color: var(--sam-danger); }

/* ── Modal ─────────────────────────────────────────────── */
.sam-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    backdrop-filter: blur(2px);
}
.sam-modal {
    background: var(--sam-white);
    border-radius: var(--sam-radius-lg);
    box-shadow: var(--sam-shadow-lg);
    width: 100%; max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: sam-modal-in .15s ease;
}
@keyframes sam-modal-in { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: none; } }
.sam-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sam-grey-200);
    display: flex; align-items: center; justify-content: space-between;
}
.sam-modal-header h3 { font-size: 17px; font-weight: 500; margin: 0; }
.sam-modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 22px; color: var(--sam-grey-500);
    line-height: 1; padding: 2px;
    transition: color .15s;
}
.sam-modal-close:hover { color: var(--sam-grey-900); }
.sam-modal-body   { padding: 24px; }
.sam-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--sam-grey-200);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Mobile hamburger nav ───────────────────────────────── */
.sam-nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    margin-right: 4px;
    flex-shrink: 0;
}
.sam-nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.sam-nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sam-nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.sam-nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .sam-nav-hamburger { display: flex; }

    .sam-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--sam-primary-dark, #1565c0);
        flex-direction: column;
        padding: 8px 0;
        z-index: 200;
        box-shadow: 0 4px 12px rgba(0,0,0,.2);
    }
    .sam-nav-links.is-open { display: flex; }

    .sam-nav-link {
        padding: 12px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
    }
    .sam-nav-link:last-child { border-bottom: none; }

    .sam-portal-nav {
        position: relative;
        flex-wrap: wrap;
    }

    .sam-nav-user {
        margin-left: auto;
    }

    .sam-user-name { display: none; }
}

/* ── Nav badge ─────────────────────────────────────────── */
.sam-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sam-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    padding: 0 5px;
    margin-left: 5px;
    line-height: 1;
}

/* ── Stat card variants ─────────────────────────────────── */
.sam-stat-icon--red { background: rgba(198,40,40,.1); color: #c62828; }
.sam-stat-card--link { text-decoration: none; cursor: pointer; transition: box-shadow .2s; }
.sam-stat-card--link:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.sam-stat-card--alert { border: 2px solid #c62828; }
.sam-stat-badge {
    display: inline-block;
    background: var(--sam-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 100px;
    margin-left: 6px;
    vertical-align: middle;
}
.sam-qa-icon--red { background: rgba(198,40,40,.1); color: #c62828; }

/* ── Inquiry Cards ──────────────────────────────────────── */
.sam-inquiries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sam-inquiry-card {
    background: var(--sam-surface);
    border: 1px solid var(--sam-grey-200);
    border-radius: var(--sam-radius);
    overflow: hidden;
    transition: box-shadow .2s;
}
.sam-inquiry-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.sam-inquiry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: var(--sam-grey-50);
    border-bottom: 1px solid var(--sam-grey-200);
    flex-wrap: wrap;
}
.sam-inquiry-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sam-inquiry-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--sam-grey-900);
}
.sam-inquiry-company {
    font-size: 13px;
    color: var(--sam-grey-500);
}
.sam-inquiry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sam-inquiry-action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sam-inquiry-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sam-inquiry-contact {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.sam-inquiry-email,
.sam-inquiry-phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--sam-primary);
    text-decoration: none;
}
.sam-inquiry-email:hover,
.sam-inquiry-phone:hover { text-decoration: underline; }
.sam-inquiry-asset-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--sam-grey-500);
    background: var(--sam-grey-100);
    padding: 3px 10px;
    border-radius: 100px;
    width: fit-content;
}
.sam-inquiry-message {
    font-size: 14px;
    color: var(--sam-grey-700);
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}
.sam-inquiry-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.sam-inquiry-date {
    font-size: 12px;
    color: var(--sam-grey-400);
}
.sam-inquiry-meta-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sam-inquiry-gdpr {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
}
.sam-inquiry-gdpr--yes {
    background: #e8f5e9;
    color: #2e7d32;
}
.sam-inquiry-gdpr--no {
    background: #fce4ec;
    color: #b71c1c;
}
.sam-inquiry-ip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--sam-grey-500);
    background: var(--sam-grey-100);
    padding: 3px 8px;
    border-radius: 100px;
    font-family: monospace;
}

/* Status badges */
.sam-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.sam-status-badge--new        { background: #e3f2fd; color: #1565c0; }
.sam-status-badge--responded  { background: #fff8e1; color: #f57f17; }
.sam-status-badge--actioned   { background: #e8f5e9; color: #2e7d32; }
/* Sponsor pipeline stage badges */
.sam-status-badge--cold     { background: #f5f5f5;  color: #616161; }
.sam-status-badge--prospect { background: #e3f2fd;  color: #1565c0; }
.sam-status-badge--ongoing  { background: #fff3e0;  color: #e65100; }
.sam-status-badge--sponsor  { background: #e8f5e9;  color: #2e7d32; }

/* xs button variant */
.sam-btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
}

/* Tab bar */
.sam-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--sam-grey-200);
    flex-wrap: wrap;
}
.sam-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sam-grey-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.sam-tab:hover  { color: var(--sam-primary); }
.sam-tab.active { color: var(--sam-primary); border-bottom-color: var(--sam-primary); }

/* ══ Sponsor CRM Pipeline ════════════════════════════════ */

/* Pipeline summary totals */
.sam-pipeline-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.sam-pipeline-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px;
    border-radius: var(--sam-radius);
    border: 2px solid transparent;
}
.sam-pipeline-summary-item--grey   { background: #f5f5f5; border-color: #bdbdbd; }
.sam-pipeline-summary-item--blue   { background: #e3f2fd; border-color: #1976d2; }
.sam-pipeline-summary-item--orange { background: #fff3e0; border-color: #f57c00; }
.sam-pipeline-summary-item--green  { background: #e8f5e9; border-color: #388e3c; }
.sam-pipeline-summary-count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--sam-grey-900);
}
.sam-pipeline-summary-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--sam-grey-600);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Kanban board */
.sam-kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}
.sam-kanban-col {
    background: var(--sam-grey-50);
    border-radius: var(--sam-radius);
    border: 1px solid var(--sam-grey-200);
    overflow: hidden;
}
.sam-kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.sam-kanban-col-header--grey   { background: #bdbdbd; color: #fff; }
.sam-kanban-col-header--blue   { background: #1976d2; color: #fff; }
.sam-kanban-col-header--orange { background: #f57c00; color: #fff; }
.sam-kanban-col-header--green  { background: #388e3c; color: #fff; }
.sam-kanban-col-count {
    background: rgba(255,255,255,.25);
    border-radius: 100px;
    padding: 1px 8px;
    font-size: 11px;
}
.sam-kanban-cards {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}
.sam-kanban-empty {
    text-align: center;
    color: var(--sam-grey-400);
    font-size: 12px;
    padding: 20px 0;
}
.sam-kanban-card {
    background: var(--sam-surface);
    border: 1px solid var(--sam-grey-200);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sam-kanban-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    transform: translateY(-1px);
}
.sam-kanban-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.sam-sponsor-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--sam-grey-900);
    line-height: 1.3;
}
.sam-sponsor-contact {
    font-size: 12px;
    color: var(--sam-grey-600);
}
.sam-sponsor-last-activity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--sam-grey-400);
}

/* Temperature badges */
.sam-temp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.sam-temp-badge--cold { background: #e3f2fd; color: #1565c0; }
.sam-temp-badge--warm { background: #fff3e0; color: #e65100; }
.sam-temp-badge--hot  { background: #ffebee; color: #b71c1c; }

/* ── Sponsor Detail Slide-in Panel ───────────────────────── */
.sam-sponsor-panel {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998 !important;
    pointer-events: none;
}
.sam-sponsor-panel.sam-sponsor-panel--open {
    pointer-events: all;
}
.sam-sponsor-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .25s;
}
.sam-sponsor-panel--open .sam-sponsor-panel-overlay {
    opacity: 1;
}
.sam-sponsor-panel-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 460px;
    max-width: 100%;
    height: 100%;
    background: #fff !important;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow: hidden;
}
.sam-sponsor-panel--open .sam-sponsor-panel-drawer {
    transform: translateX(0);
}
.sam-sponsor-panel-header-main { display: flex; align-items: center; gap: 14px; }
.sam-sponsor-panel-logo img { max-height: 52px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.sam-logo-upload-wrap { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.sam-logo-preview { min-width: 80px; }
.sam-logo-preview img { max-height: 60px; max-width: 160px; object-fit: contain; border: 1px solid var(--sam-grey-200); border-radius: 4px; padding: 4px; background: #fff; }
.sam-logo-actions { display: flex; flex-direction: column; gap: 6px; }
.sam-sponsor-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sam-grey-200);
    gap: 12px;
    flex-shrink: 0;
}
.sam-sponsor-panel-company {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sam-grey-900);
}
.sam-sponsor-panel-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sam-sponsor-panel-footer {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--sam-grey-200);
    margin-top: 8px;
}
.sam-sponsor-panel-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--sam-grey-400);
    padding: 0;
}
.sam-sponsor-panel-close:hover { color: var(--sam-grey-900); }
.sam-sponsor-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Contact info grid */
.sam-sponsor-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--sam-grey-50);
    border-radius: 6px;
    padding: 14px;
}
.sam-contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sam-contact-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sam-grey-400);
    font-weight: 600;
}
.sam-contact-value {
    font-size: 13px;
    color: var(--sam-grey-800);
    word-break: break-all;
}
.sam-contact-value a { color: var(--sam-primary); text-decoration: none; }
.sam-contact-value a:hover { text-decoration: underline; }

/* Stage quick-change bar */
.sam-sponsor-stage-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sam-stage-btn {
    flex: 1;
    padding: 8px 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--sam-grey-100);
    color: var(--sam-grey-600);
    transition: all .15s;
    text-align: center;
}
.sam-stage-btn:hover { opacity: .85; }
.sam-stage-btn--grey.active,   .sam-stage-btn--grey:hover   { background: #bdbdbd; color: #fff; border-color: #bdbdbd; }
.sam-stage-btn--blue.active,   .sam-stage-btn--blue:hover   { background: #1976d2; color: #fff; border-color: #1976d2; }
.sam-stage-btn--orange.active, .sam-stage-btn--orange:hover { background: #f57c00; color: #fff; border-color: #f57c00; }
.sam-stage-btn--green.active,  .sam-stage-btn--green:hover  { background: #388e3c; color: #fff; border-color: #388e3c; }

/* Notes section */
.sam-sponsor-notes-section h4,
.sam-sponsor-log-form h4,
.sam-sponsor-timeline h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sam-grey-500);
}
.sam-sponsor-notes-section p {
    font-size: 14px;
    color: var(--sam-grey-700);
    line-height: 1.6;
    background: var(--sam-grey-50);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0;
    white-space: pre-line;
}

/* Log form */
.sam-log-form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.sam-log-textarea {
    width: 100%;
    border: 1px solid var(--sam-grey-300);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.sam-log-textarea:focus { outline: none; border-color: var(--sam-primary); }

/* Activity timeline */
.sam-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sam-timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    position: relative;
}
.sam-timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--sam-grey-200);
}
.sam-timeline-item:last-child::before { display: none; }
.sam-timeline-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--sam-grey-100);
    color: var(--sam-grey-500);
    z-index: 1;
}
.sam-timeline-icon--note          { background: #e3f2fd; color: #1976d2; }
.sam-timeline-icon--email_sent    { background: #e8f5e9; color: #388e3c; }
.sam-timeline-icon--email_received{ background: #f3e5f5; color: #7b1fa2; }
.sam-timeline-icon--call          { background: #fff3e0; color: #f57c00; }
.sam-timeline-icon--meeting       { background: #fce4ec; color: #c62828; }
.sam-timeline-icon--status_change { background: #f5f5f5; color: #616161; }
.sam-timeline-body { flex: 1; }
.sam-timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.sam-timeline-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--sam-grey-700);
}
.sam-timeline-date {
    font-size: 11px;
    color: var(--sam-grey-400);
}
.sam-timeline-note {
    font-size: 13px;
    color: var(--sam-grey-700);
    line-height: 1.5;
    white-space: pre-line;
}
.sam-timeline-user {
    font-size: 11px;
    color: var(--sam-grey-400);
    margin-top: 2px;
}
.sam-timeline-empty {
    text-align: center;
    color: var(--sam-grey-400);
    font-size: 13px;
    padding: 20px 0;
}

/* ── Sponsor Add/Edit Modal ────────────────────────────── */
.sam-sponsor-modal {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 999999 !important;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.sam-sponsor-modal.sam-sponsor-modal--open {
    display: flex !important;
}
.sam-sponsor-modal-content {
    background: #fff !important;
    border-radius: var(--sam-radius);
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    margin: auto;
}
.sam-sponsor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sam-grey-200);
}
.sam-sponsor-modal-header h3 { margin: 0; font-size: 1.2rem; }
.sam-sponsor-modal-close {
    background: none; border: none; font-size: 26px;
    cursor: pointer; color: var(--sam-grey-400); line-height: 1;
}
.sam-sponsor-modal-close:hover { color: var(--sam-grey-900); }
#sam-sponsor-form { padding: 20px 24px; }
.sam-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.sam-form-field { display: flex; flex-direction: column; gap: 5px; }
.sam-form-field label { font-size: 13px; font-weight: 500; color: var(--sam-grey-700); }
.sam-input {
    border: 1px solid var(--sam-grey-300);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}
.sam-input:focus { outline: none; border-color: var(--sam-primary); }
.sam-sponsor-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--sam-grey-200);
}

/* btn-sm variant */
.sam-btn-sm { padding: 6px 14px; font-size: 12px; }
.sam-btn-danger { background: var(--sam-danger) !important; color: #fff !important; }

/* Responsive */
@media (max-width: 900px) {
    .sam-kanban-board        { grid-template-columns: 1fr 1fr; }
    .sam-pipeline-summary    { grid-template-columns: repeat(2, 1fr); }
    .sam-sponsor-panel-drawer{ width: 100%; }
}
@media (max-width: 600px) {
    .sam-kanban-board { grid-template-columns: 1fr; }
    .sam-form-grid-2  { grid-template-columns: 1fr; }
}

/* ══ Agreements ══════════════════════════════════════════ */

/* Agreements table */
.sam-agreements-table-wrap {
    overflow-x: auto;
    border-radius: var(--sam-radius);
    border: 1px solid var(--sam-grey-200);
}
.sam-agreements-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.sam-agreements-table thead th {
    background: var(--sam-grey-50);
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sam-grey-500);
    border-bottom: 1px solid var(--sam-grey-200);
    white-space: nowrap;
}
.sam-agreements-table tbody tr {
    border-bottom: 1px solid var(--sam-grey-100);
    transition: background .1s;
}
.sam-agreements-table tbody tr:last-child { border-bottom: none; }
.sam-agreements-table tbody tr:hover { background: var(--sam-grey-50); }
.sam-agreements-table td {
    padding: 12px 16px;
    vertical-align: middle;
}
.sam-agr-sponsor strong { display: block; font-weight: 600; color: var(--sam-grey-900); }
.sam-agr-ref { font-size: 11px; color: var(--sam-grey-400); }
.sam-agr-assets { max-width: 220px; color: var(--sam-grey-700); }
.sam-agr-value strong { display: block; font-weight: 600; }
.sam-agr-ex-vat { font-size: 11px; color: var(--sam-grey-400); }
.sam-agr-actions { white-space: nowrap; text-align: right; }

/* Agreement status badges */
.sam-agr-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.sam-agr-status-badge--draft     { background: #f5f5f5;  color: #616161; }
.sam-agr-status-badge--active    { background: #e8f5e9;  color: #2e7d32; }
.sam-agr-status-badge--expired   { background: #fff3e0;  color: #e65100; }
.sam-agr-status-badge--cancelled { background: #fce4ec;  color: #c62828; }

/* Payment status badges */
.sam-pay-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.sam-pay-badge--pending   { background: #fff3e0; color: #e65100; }
.sam-pay-badge--invoiced  { background: #e3f2fd; color: #1565c0; }
.sam-pay-badge--part_paid { background: #f3e5f5; color: #6a1b9a; }
.sam-pay-badge--paid      { background: #e8f5e9; color: #2e7d32; }

/* Agreement modal */
.sam-agreement-modal {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 999999 !important;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.sam-agreement-modal.sam-agreement-modal--open {
    display: flex !important;
}
.sam-agreement-modal-content {
    background: #fff !important;
    border-radius: var(--sam-radius);
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    margin: auto;
}
.sam-agreement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sam-grey-200);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.sam-agreement-modal-header h3 { margin: 0; font-size: 1.1rem; }
.sam-agreement-modal-close {
    background: none; border: none; font-size: 26px;
    cursor: pointer; color: var(--sam-grey-400); line-height: 1;
}
.sam-agreement-modal-close:hover { color: var(--sam-grey-900); }
.sam-agreement-form-body {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.sam-agr-field { display: flex; flex-direction: column; gap: 5px; }
.sam-agr-field label { font-size: 13px; font-weight: 500; color: var(--sam-grey-700); }
.sam-agr-field--full { grid-column: 1 / -1; }
.sam-agr-sponsor-select-wrap { grid-column: 1 / -1; }
.sam-field-hint { font-size: 12px; color: var(--sam-grey-400); margin: 0 0 6px; }
.sam-agreement-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--sam-grey-200);
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* VAT calculator */
.sam-vat-calculator {
    background: var(--sam-grey-50);
    border: 1px solid var(--sam-grey-200);
    border-radius: 8px;
    padding: 14px 16px;
}
.sam-vat-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 12px;
    align-items: end;
}
.sam-vat-field { display: flex; flex-direction: column; gap: 4px; }
.sam-vat-field label { font-size: 12px; font-weight: 500; color: var(--sam-grey-600); }
.sam-input--readonly {
    background: var(--sam-grey-100) !important;
    color: var(--sam-grey-700);
    cursor: not-allowed;
}
.sam-input--total {
    font-weight: 700;
    font-size: 16px;
    color: var(--sam-grey-900) !important;
    background: #e8f5e9 !important;
}

/* Asset checklist */
.sam-asset-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--sam-grey-200);
    border-radius: 6px;
    padding: 8px;
    background: #fff;
}
.sam-asset-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s;
    border: 1px solid transparent;
}
.sam-asset-check-item:hover { background: var(--sam-grey-50); }
.sam-asset-check-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--sam-primary);
}
.sam-asset-check-item input:checked ~ * { font-weight: 500; }
.sam-asset-check-item--sold { opacity: .65; }
.sam-asset-check-wrap { display: flex; flex-direction: column; }
.sam-asset-detail-input {
    margin: 2px 10px 6px 36px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
}
.sam-asset-check-name { flex: 1; font-size: 13px; color: var(--sam-grey-800); }
.sam-asset-check-price { font-size: 12px; color: var(--sam-grey-500); }
.sam-asset-check-avail { flex-shrink: 0; }

/* Tab count badge */
.sam-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--sam-grey-200);
    color: var(--sam-grey-700);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    margin-left: 4px;
}
.sam-tab.active .sam-tab-count {
    background: var(--sam-primary);
    color: #fff;
}

/* Sponsor panel — agreements section */
.sam-sponsor-agreements {
    border-top: 1px solid var(--sam-grey-200);
    padding-top: 16px;
}
.sam-sponsor-agreements-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.sam-sponsor-agreements-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sam-grey-500);
}
.sam-panel-agreement-card {
    background: var(--sam-grey-50);
    border: 1px solid var(--sam-grey-200);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.sam-panel-agr-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.sam-panel-agr-assets {
    font-size: 13px;
    font-weight: 500;
    color: var(--sam-grey-800);
    flex: 1;
}
.sam-panel-agr-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--sam-grey-900);
    white-space: nowrap;
}
.sam-panel-agr-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--sam-grey-400);
}
.sam-panel-agr-edit {
    font-size: 11px;
    color: var(--sam-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.sam-no-agreements {
    text-align: center;
    color: var(--sam-grey-400);
    font-size: 13px;
    padding: 16px 0;
}

/* Email agreement modal */
.sam-email-modal {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 9999999 !important;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.sam-email-modal.sam-email-modal--open { display: flex !important; }
.sam-email-modal-content {
    background: #fff !important;
    border-radius: var(--sam-radius);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sam-email-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--sam-grey-200);
}
.sam-email-modal-header h3 { margin: 0; font-size: 1rem; }
.sam-email-modal-close {
    background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--sam-grey-400); line-height: 1;
}
.sam-email-modal-close:hover { color: var(--sam-grey-900); }
.sam-email-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sam-email-preview-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #e3f2fd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1565c0;
    line-height: 1.5;
}
.sam-email-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--sam-grey-200);
}

/* Panel agreement PDF/Email links */
.sam-panel-agr-pdf,
.sam-panel-agr-email {
    font-size: 11px;
    color: var(--sam-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.sam-panel-agr-email { color: #e65100; }

/* Responsive */
@media (max-width: 768px) {
    .sam-vat-row { grid-template-columns: 1fr 1fr; }
    .sam-agreement-form-body { grid-template-columns: 1fr; }
    .sam-agr-field--full { grid-column: 1; }
    .sam-agreements-table td:nth-child(2),
    .sam-agreements-table th:nth-child(2) { display: none; }
}

/* ── Signature Badges ──────────────────────────────────── */
.sam-sig-cell { white-space: nowrap; }
.sam-sig-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.sam-sig-badge--none     { background: #f5f5f5; color: #9e9e9e; }
.sam-sig-badge--sent     { background: #e3f2fd; color: #1565c0; }
.sam-sig-badge--viewed   { background: #fff3e0; color: #e65100; }
.sam-sig-badge--signed   { background: #e8f5e9; color: #2e7d32; }
.sam-sig-badge--expired  { background: #fce4ec; color: #c62828; }
.sam-sig-badge--revoked  { background: #f3e5f5; color: #6a1b9a; }
.sam-sig-signer {
    display: block;
    font-size: 11px;
    color: var(--sam-grey-500);
    margin-top: 2px;
    font-style: italic;
}

/* Sign info banner (inside send modal) */
.sam-sign-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #e8f5e9;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12.5px;
    color: #2e7d32;
    line-height: 1.6;
}

/* ── Settings Page ─────────────────────────────────────── */
.sam-settings-form { display: flex; flex-direction: column; gap: 24px; }
.sam-settings-card {
    background: #fff;
    border: 1px solid var(--sam-grey-200);
    border-radius: var(--sam-radius);
    padding: 24px 28px;
}
.sam-settings-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sam-grey-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sam-grey-100);
}
.sam-settings-card-title svg { width: 18px; height: 18px; color: var(--sam-primary); flex-shrink: 0; }
.sam-settings-section-note { font-size: 12.5px; color: var(--sam-grey-500); margin: -8px 0 14px; }
.sam-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 16px;
}
.sam-settings-field { display: flex; flex-direction: column; gap: 6px; }
.sam-settings-field label { font-size: 12.5px; font-weight: 500; color: var(--sam-grey-700); }
.sam-settings-field--full { grid-column: 1 / -1; }
.sam-field-hint { font-size: 11.5px; color: var(--sam-grey-400); margin-top: 2px; }

/* Color picker */
.sam-color-row { display: flex; align-items: center; gap: 10px; }
.sam-color-picker { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--sam-grey-200); border-radius: 6px; cursor: pointer; background: none; }
.sam-color-hex { flex: 1; font-family: monospace; text-transform: uppercase; }
.sam-color-swatch { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--sam-grey-200); flex-shrink: 0; }

/* Logo uploader */
.sam-logo-uploader { display: flex; flex-direction: column; gap: 12px; }
.sam-logo-preview {
    width: 220px; height: 100px;
    border: 2px dashed var(--sam-grey-200);
    border-radius: var(--sam-radius);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: var(--sam-grey-50);
}
.sam-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sam-logo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--sam-grey-400); font-size: 12px; }
.sam-logo-placeholder svg { width: 28px; height: 28px; }
.sam-logo-actions { display: flex; gap: 10px; }
.sam-btn-outline--danger { color: #c62828 !important; border-color: #c62828 !important; }
.sam-btn-outline--danger:hover { background: #fff3f3 !important; }

/* Settings footer */
.sam-settings-footer { display: flex; justify-content: flex-end; padding: 4px 0 8px; }

@media (max-width: 600px) {
    .sam-settings-row { grid-template-columns: 1fr; }
    .sam-settings-field--full { grid-column: 1; }
}

/* ── Slots Bar ─────────────────────────────────────────── */
.sam-slots-bar {
    height: 8px;
    background: var(--sam-grey-200);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 6px;
}
.sam-slots-bar-fill {
    height: 100%;
    background: var(--sam-success);
    border-radius: 100px;
    transition: width .3s ease, background .3s;
}
.sam-slots-bar-fill--warn { background: #f57c00; }
.sam-slots-bar-fill--full { background: var(--sam-danger); }

/* ── Upload Progress ───────────────────────────────────── */
.sam-upload-progress {
    height: 4px;
    background: var(--sam-grey-200);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 8px;
}
.sam-upload-progress-bar {
    height: 100%;
    background: var(--sam-primary);
    border-radius: 100px;
    transition: width .1s linear;
}
.sam-upload-label {
    cursor: pointer;
    margin-top: 10px;
}

/* ── Slots badge (frontend card) ───────────────────────── */
.sam-slots-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.sam-slots-mini-bar {
    height: 5px;
    background: var(--sam-grey-200);
    border-radius: 100px;
    overflow: hidden;
}
.sam-slots-mini-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--sam-success);
}
.sam-slots-mini-fill--warn { background: #f57c00; }
.sam-slots-mini-fill--full { background: var(--sam-danger); }
.sam-slots-text { font-size: 12px; color: var(--sam-grey-500); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sam-form-grid { grid-template-columns: 1fr; }
    .sam-form-sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 768px) {
    .sam-portal-nav     { padding: 0 16px; gap: 12px; }
    .sam-nav-links      { display: none; }
    .sam-portal-header  { padding: 16px; flex-direction: column; align-items: flex-start; }
    .sam-portal-content { padding: 16px; }
    .sam-portal-grid-2  { grid-template-columns: 1fr; }
    .sam-stats-grid     { grid-template-columns: repeat(2, 1fr); }
    .sam-field-row-2    { grid-template-columns: 1fr; }
    .sam-allocate-form  { flex-direction: column; }
    .sam-allocate-form .sam-select { width: 100%; }
    .sam-user-info      { display: none; }
}
@media (max-width: 480px) {
    .sam-stats-grid     { grid-template-columns: 1fr; }
    .sam-login-card     { padding: 24px; }
}
