/**
 * Admin Components CSS
 *
 * Cherry-picked component styles from portal.css + admin-specific additions.
 * Uses the same design tokens from portal-layout.css for visual consistency.
 *
 * @package Vantage_Admin
 * @since 2.0.0
 */

/* ==========================================================================
   BUTTONS (from portal.css lines 14-106)
   ========================================================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--brand-primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 28px;
    background: transparent;
    color: var(--brand-dark);
    border: 2px solid var(--brand-dark);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--brand-dark);
    color: #fff;
    text-decoration: none;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    background: var(--brand-primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-save:hover {
    background: var(--brand-primary-dark);
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cd-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cd-btn-outline:hover {
    background: var(--brand-primary);
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   STATUS BADGES (from portal.css lines 148-175)
   ========================================================================== */

.event-badge,
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.badge-open,
.badge-complete,
.badge-active {
    background: var(--brand-primary);
    color: #fff;
}

.badge-closed,
.badge-inactive {
    background: #6c757d;
    color: #fff;
}

.badge-pending {
    background: var(--status-warning);
    color: var(--brand-dark);
}

.badge-error {
    background: var(--status-error);
    color: #fff;
}

/* ==========================================================================
   SECTION HEADERS (from portal.css lines 375-418)
   ========================================================================== */

.cd-section {
    margin-bottom: 32px;
}

.cd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cd-section-title {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cd-section-title svg {
    width: 20px;
    height: 20px;
}

.cd-section-link {
    font-size: 14px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.cd-section-link:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

.cd-section-desc {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin: 4px 0 0 0;
}

/* ==========================================================================
   ACTION NEEDED CARDS (from portal.css lines 420-461)
   ========================================================================== */

.cd-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #f0ad4e;
    border-radius: 12px;
    margin-bottom: 12px;
}

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

.cd-action-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 2px;
}

.cd-action-meta {
    font-size: 13px;
    color: var(--brand-text-muted);
}

.cd-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f0ad4e;
    color: var(--brand-dark);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.cd-btn-action:hover {
    background: #ec971f;
    color: var(--brand-dark);
    text-decoration: none;
}

/* ==========================================================================
   EVENT ROW CARDS (from portal.css lines 463-540)
   ========================================================================== */

.cd-event-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.cd-event-row:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--card-shadow-hover);
}

.cd-event-row-thumb {
    width: 100px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.cd-event-row-info {
    flex: 1;
    min-width: 0;
}

.cd-event-row-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 2px;
}

.cd-event-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   SETTINGS SECTIONS (from portal.css lines 4914-5017)
   ========================================================================== */

.settings-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #fafbfc;
    border-bottom: 1px solid #e9ecef;
}

.settings-section-header h3 {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-dark);
    margin: 0;
}

.settings-section-body {
    padding: 24px;
}

/* ==========================================================================
   FORM SYSTEM (from portal.css lines 4949-5017)
   ========================================================================== */

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row-2col,
    .form-row-3col {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--brand-text);
    transition: border-color var(--transition-fast);
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(103, 198, 180, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.form-hint {
    font-size: 12px;
    color: #6c757d;
}

/* ==========================================================================
   SAVE/STATUS INDICATORS (from portal.css lines 5056-5098)
   ========================================================================== */

.save-status {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    margin-left: 12px;
    transition: opacity var(--transition-fast);
}

.save-status.saving {
    color: #6c757d;
}

.save-status.success {
    color: var(--status-success);
}

.save-status.error {
    color: var(--status-error);
}

/* ==========================================================================
   MESSAGES (from portal.css lines 5101-5120)
   ========================================================================== */

.settings-message {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.settings-message.show {
    display: block;
}

.settings-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.settings-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   TOGGLE SWITCHES (from portal.css lines 5149-5195)
   ========================================================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 28px;
    transition: background var(--transition-fast);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--brand-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ==========================================================================
   EMPTY STATES (from portal.css lines 927-963)
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    color: var(--brand-primary);
    margin: 0 auto 16px;
}

.empty-state__icon svg {
    width: 100%;
    height: 100%;
}

.empty-state__title {
    font-family: var(--font-family-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 8px 0;
}

.empty-state__text {
    font-size: 15px;
    color: var(--brand-text-muted);
    margin: 0 0 24px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   ADMIN-SPECIFIC: Collapsible Nav Group (new)
   ========================================================================== */

.portal-nav-group {
    margin-top: 8px;
    border-top: 1px solid var(--sidebar-divider);
    padding-top: 8px;
}

.portal-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin: 2px var(--space-sm);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.portal-nav-group-toggle:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.portal-nav-group-toggle .portal-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.portal-nav-group-toggle .portal-nav-label {
    flex: 1;
}

.portal-nav-group-toggle .chevron {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.portal-nav-group.open .portal-nav-group-toggle .chevron {
    transform: rotate(90deg);
}

.portal-nav-group-items {
    display: none;
    padding-left: var(--space-md);
}

.portal-nav-group.open .portal-nav-group-items {
    display: block;
}

.portal-nav-group-items .portal-nav-link {
    font-size: 13px;
    padding: 6px var(--space-md);
}

/* ==========================================================================
   ADMIN-SPECIFIC: Stat Card Variants (new)
   ========================================================================== */

.portal-stat-icon.events {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.portal-stat-icon.talent {
    background: rgba(103, 198, 180, 0.15);
    color: var(--brand-primary);
}

.portal-stat-icon.clients {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.portal-stat-icon.revenue {
    background: rgba(40, 167, 69, 0.15);
    color: var(--status-success);
}

.portal-stat-icon.alerts {
    background: rgba(220, 53, 69, 0.15);
    color: var(--status-error);
}

/* ==========================================================================
   ADMIN-SPECIFIC: Filter Bar (new)
   ========================================================================== */

.admin-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: var(--space-lg);
    align-items: center;
}

.admin-filter-bar select,
.admin-filter-bar input[type="text"],
.admin-filter-bar input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--brand-text);
    transition: border-color var(--transition-fast);
}

.admin-filter-bar select:focus,
.admin-filter-bar input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.admin-filter-bar .btn-filter {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.admin-filter-bar .btn-filter-clear {
    background: none;
    border: none;
    color: var(--brand-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
}

/* ==========================================================================
   ADMIN-SPECIFIC: Modal (new)
   ========================================================================== */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
}

.admin-modal-overlay.open {
    display: flex;
}

.admin-modal {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.admin-modal-title {
    font-family: var(--font-family-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0;
}

.admin-modal-close {
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--brand-text-muted);
    border-radius: 6px;
}

.admin-modal-close:hover {
    background: #f0f0f0;
    color: var(--brand-text);
}

.admin-modal-close svg {
    width: 20px;
    height: 20px;
}

.admin-modal-body {
    padding: 24px;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
}

/* ==========================================================================
   ADMIN-SPECIFIC: DataTables Override (new)
   ========================================================================== */

.dataTables_wrapper {
    font-family: var(--font-family);
}

table.dataTable thead th {
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
    border-bottom: 2px solid #e9ecef;
    padding: 12px 16px;
    background: #fafbfc;
}

table.dataTable tbody td {
    font-size: 14px;
    color: var(--brand-text);
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

table.dataTable tbody tr:hover {
    background: rgba(103, 198, 180, 0.04);
}

.dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    font-size: 13px;
    font-weight: 600;
}

.dataTables_paginate .paginate_button.current {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    color: #fff !important;
}

.dataTables_filter input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(103, 198, 180, 0.1);
}

.dataTables_info {
    font-size: 13px;
    color: var(--brand-text-muted);
}

.dataTables_length select {
    padding: 6px 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
}

.admin-table-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: var(--space-lg);
}

.table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.table-avatar-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-status-active    { background: #d4edda; color: #155724; }
.table-status-pending   { background: #fff3cd; color: #856404; }
.table-status-inactive  { background: #e9ecef; color: #6c757d; }
.table-status-booked    { background: #e8f5f2; color: #0d6e5d; }

/* ==========================================================================
   ADMIN-SPECIFIC: Sidebar Badge (new)
   ========================================================================== */

.portal-nav-badge {
    background: var(--status-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* ==========================================================================
   XCRUD COMPATIBILITY
   Minimal overrides to prevent xCRUD content from clashing with portal layout.
   ========================================================================== */

.xcrud-container {
    font-family: var(--font-family);
}

.xcrud-container .xcrud-top,
.xcrud-container .xcrud-nav {
    font-family: var(--font-family);
}

/* Ensure xCRUD pagination doesn't conflict */
.xcrud-container .xcrud-nav .active {
    z-index: 0;
}

/* ==========================================================================
   DASHBOARD PAGE
   ========================================================================== */

.dashboard-page {
    max-width: 1400px;
}

.dashboard-page .cd-section {
    margin-bottom: 24px;
}

.dashboard-page .cd-section-title {
    font-size: 24px;
    font-weight: 700;
}

.cd-section-subtitle {
    font-size: 14px;
    color: var(--brand-text-muted);
    font-weight: 400;
}

/* KPI Section Labels */
.kpi-section {
    margin-bottom: 28px;
}

.kpi-section-label {
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-text-muted);
    margin: 0 0 12px 0;
}

/* Stat card icon variants not yet covered */
.portal-stat-icon.success {
    background: rgba(40, 167, 69, 0.15);
    color: var(--status-success);
}

.portal-stat-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Clickable stat card */
.portal-stat-card.clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.portal-stat-card.clickable:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--card-shadow-hover);
}

/* ==========================================================================
   PIPELINE SUMMARY
   ========================================================================== */

.pipeline-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pipeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-text);
    width: 120px;
    flex-shrink: 0;
}

.pipeline-bar-track {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.pipeline-bar-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.4s ease;
}

.pipeline-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.pipeline-divider {
    height: 1px;
    background: #e9ecef;
    margin: 16px 0;
}

.pipeline-sub-title {
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-text-muted);
    margin: 0 0 12px 0;
}

/* ==========================================================================
   ACTIVITY TIMELINE
   ========================================================================== */

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e9ecef;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.activity-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    background: #fff;
    border: 2px solid #e9ecef;
}

.activity-dot svg {
    width: 14px;
    height: 14px;
}

.activity-dot.type-email {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.activity-dot.type-status {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(103, 198, 180, 0.1);
}

.activity-dot.type-application {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.activity-dot.type-feedback {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.activity-dot.type-alert {
    border-color: var(--status-error);
    color: var(--status-error);
    background: rgba(220, 53, 69, 0.1);
}

.activity-dot.type-info {
    border-color: #94a3b8;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
}

.activity-content {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.activity-description {
    font-size: 13px;
    color: var(--brand-text);
    line-height: 1.5;
}

.activity-description strong {
    font-weight: 600;
    color: var(--brand-dark);
}

.activity-time {
    font-size: 12px;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   ADMIN TABLE (simple table for dashboard)
   ========================================================================== */

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
    border-bottom: 2px solid #e9ecef;
    padding: 10px 16px;
    text-align: left;
    background: #fafbfc;
}

.admin-table tbody td {
    font-size: 14px;
    color: var(--brand-text);
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

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

.admin-table tbody tr:hover {
    background: rgba(103, 198, 180, 0.04);
}

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

/* ==========================================================================
   PORTAL CARD (generic white card wrapper)
   ========================================================================== */

.portal-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
}

.portal-card-title {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-dark);
    margin: 0;
}

.portal-card-body {
    padding: 20px;
}

/* Empty state inside cards (smaller padding) */
.portal-card-body .empty-state {
    box-shadow: none;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--brand-text-muted);
    margin: 0 auto 12px;
    opacity: 0.4;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state p {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin: 0;
}

/* ==========================================================================
   NOTIFICATION DROPDOWN
   ========================================================================== */

.portal-notifications {
    position: relative;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
}

.notification-dropdown-title {
    font-family: var(--font-family-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-dark);
}

.notification-mark-all {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.notification-mark-all:hover {
    background: rgba(103, 198, 180, 0.1);
}

.notification-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

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

.notification-item:hover {
    background: #f8f9fa;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 14px;
    height: 14px;
}

.notification-icon.type-email {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.type-status {
    background: rgba(103, 198, 180, 0.1);
    color: var(--brand-primary);
}

.notification-icon.type-application {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notification-icon.type-feedback {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.type-alert {
    background: rgba(220, 53, 69, 0.1);
    color: var(--status-error);
}

.notification-icon.type-info {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

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

.notification-text {
    font-size: 13px;
    color: var(--brand-text);
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

.notification-dismiss {
    background: none;
    border: none;
    font-size: 16px;
    color: #ccc;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.notification-dismiss:hover {
    color: var(--brand-text-muted);
}

.notification-empty {
    text-align: center;
    padding: 32px 16px;
    font-size: 13px;
    color: var(--brand-text-muted);
}

/* ==========================================================================
   APPLICATION QUEUE
   ========================================================================== */

.applications-page {
    max-width: 1200px;
}

/* ==========================================================================
   APPLICATION CARDS (v2.2 — Session 34 UI Polish)
   ========================================================================== */

/* Controls bar: select-all, bulk actions, sort, search */
.app-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}
.app-controls-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.app-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
}
.app-select-all-label input { cursor: pointer; accent-color: var(--brand-primary); }
.app-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bulk-count {
    font-size: 12px;
    color: #6b7280;
    margin-left: 4px;
}
.app-search {
    padding: 8px 14px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    width: 240px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.app-search:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(103,198,180,0.15);
}
.app-sort {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    font-family: var(--font-family);
    cursor: pointer;
}

/* Card: uses .portal-card as base, .app-card adds layout */
.app-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 12px;
    position: relative;
}
.app-card:hover {
    box-shadow: var(--card-shadow-hover);
}
.app-card-stale {
    opacity: 0.55;
}
.app-card-stale:hover { opacity: 0.75; }

/* Checkbox */
.app-card-select { flex-shrink: 0; padding-top: 2px; }
.app-checkbox { cursor: pointer; width: 16px; height: 16px; accent-color: var(--brand-primary); }

/* Photo */
.app-card-photo { flex-shrink: 0; width: 68px; height: 68px; }
.app-card-photo img,
.app-photo {
    width: 68px;
    height: 68px;
    max-width: 68px;
    max-height: 68px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9ecef;
    display: block;
}
.app-photo-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), #5ab3a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

/* Card body */
.app-card-body { flex: 1; min-width: 0; }
.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 6px;
}
.app-card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.app-card-name {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-dark);
    text-decoration: none;
}
.app-card-name:hover { color: var(--brand-primary); }

/* Completeness bar */
.app-card-completeness {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.app-comp-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-dark);
    min-width: 36px;
    text-align: right;
}
.app-comp-bar {
    width: 80px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}
.app-comp-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.app-comp-fill.high { background: var(--status-success); }
.app-comp-fill.medium { background: var(--status-warning); }
.app-comp-fill.low { background: var(--status-error); }
.app-comp-count {
    font-size: 12px;
    color: #6c757d;
}

/* Meta line */
.app-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}
.app-card-meta span:not(:last-child)::after {
    content: '\00a0\00b7\00a0';
    color: #ccc;
}

/* Missing fields */
.app-card-missing {
    font-size: 12px;
    color: #dc3545;
    margin-top: 6px;
}
.app-card-missing::before {
    content: 'Missing: ';
    font-weight: 600;
}

/* Actions row */
.app-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}
.app-saving { font-size: 13px; color: #6c757d; }
.app-error { font-size: 13px; color: #dc3545; }

/* Action button variants */
.btn-view {
    background: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
}
.btn-view:hover {
    background: var(--brand-primary);
    color: #fff;
}
.btn-approve {
    background: #28a745;
    color: #fff;
    border: 1px solid #28a745;
}
.btn-approve:hover {
    background: #218838;
    border-color: #218838;
}
.btn-decline {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}
.btn-decline:hover {
    background: #dc3545;
    color: #fff;
}
.btn-decline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state */
.app-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 14px;
}

/* Pagination */
.app-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 4px;
}
.app-page-info {
    font-size: 13px;
    color: #6c757d;
}
.app-page-btns {
    display: flex;
    gap: 4px;
}
.app-page-btns button {
    padding: 6px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.app-page-btns button:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.app-page-btns button.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* Decline Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
}
.modal-title {
    font-family: var(--font-family-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.modal-close:hover { color: var(--brand-dark); }
.modal-body { padding: 20px 24px; }
.modal-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 20px;
}
.modal-field { margin-bottom: 16px; }
.modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 8px;
}
.decline-reasons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.decline-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.15s;
}
.decline-reason:hover {
    border-color: var(--brand-primary);
    background: #f0faf8;
}
.decline-reason:has(input:checked) {
    border-color: var(--brand-primary);
    background: #f0faf8;
}
.decline-reason input { cursor: pointer; accent-color: var(--brand-primary); }
.modal-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family);
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
.modal-textarea:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(103,198,180,0.15);
}
.decline-email-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.decline-email-toggle input { accent-color: var(--brand-primary); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 24px;
}

/* ==========================================================================
   CLIENT HEALTH SCORES
   ========================================================================== */

.health-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}

.health-tier {
    flex: 1;
    text-align: center;
    padding: 16px 12px;
    border-radius: 10px;
}

.health-tier-count {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.health-tier-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-healthy {
    background: rgba(40, 167, 69, 0.1);
}

.health-healthy .health-tier-count {
    color: var(--status-success);
}

.health-healthy .health-tier-label {
    color: #218838;
}

.health-at-risk {
    background: rgba(245, 158, 11, 0.1);
}

.health-at-risk .health-tier-count {
    color: #f59e0b;
}

.health-at-risk .health-tier-label {
    color: #d97706;
}

.health-critical {
    background: rgba(220, 53, 69, 0.1);
}

.health-critical .health-tier-count {
    color: var(--status-error);
}

.health-critical .health-tier-label {
    color: #c82333;
}

.health-divider {
    height: 1px;
    background: #e9ecef;
    margin: 16px 0;
}

.health-clients {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.health-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fafbfc;
    border-radius: 8px;
}

.health-client-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.health-client-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-dark);
}

.health-client-meta {
    font-size: 12px;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

.health-score-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.health-badge-at_risk {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.health-badge-critical {
    background: rgba(220, 53, 69, 0.15);
    color: var(--status-error);
}

.health-badge-healthy {
    background: rgba(40, 167, 69, 0.15);
    color: var(--status-success);
}

@media (max-width: 480px) {
    .health-summary {
        gap: 8px;
    }

    .health-tier-count {
        font-size: 22px;
    }
}

/* ==========================================================================
   FEEDBACK & RECAP VIEWER
   ========================================================================== */

.feedback-page,
.recaps-page {
    max-width: 1200px;
}

.rating-stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 1px;
}

.rating-low {
    color: var(--status-error);
}

.dispute-flag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(220, 53, 69, 0.1);
    color: var(--status-error);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
}

/* ==========================================================================
   FULLCALENDAR OVERRIDES
   ========================================================================== */

#adminCalendar {
    font-family: var(--font-family);
}

#adminCalendar .fc-toolbar-title {
    font-family: var(--font-family-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-dark);
}

#adminCalendar .fc-button-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

#adminCalendar .fc-button-primary:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

#adminCalendar .fc-button-primary:not(:disabled).fc-button-active,
#adminCalendar .fc-button-primary:not(:disabled):active {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

#adminCalendar .fc-daygrid-day-number {
    font-size: 13px;
    color: var(--brand-text);
    padding: 4px 8px;
}

#adminCalendar .fc-daygrid-day.fc-day-today {
    background: rgba(103, 198, 180, 0.06);
}

#adminCalendar .fc-event {
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 4px;
    cursor: pointer;
}

#adminCalendar .fc-col-header-cell-cushion {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
}

/* Calendar Event Click Popup */
.calendar-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
}

.calendar-popup-overlay.open {
    display: flex;
}

.calendar-popup {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.calendar-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
}

.calendar-popup-header h3 {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
}

.calendar-popup-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.calendar-popup-close:hover {
    color: var(--brand-dark);
}

.calendar-popup-body {
    padding: 16px 20px;
}

.calendar-popup-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.calendar-popup-row:last-child {
    border-bottom: none;
}

.calendar-popup-label {
    font-weight: 600;
    color: var(--brand-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   RESPONSIVE: Dashboard
   ========================================================================== */

@media (max-width: 768px) {
    .pipeline-label {
        width: 90px;
        font-size: 12px;
    }

    .pipeline-count {
        width: 28px;
        font-size: 13px;
    }

    .activity-timeline::before {
        display: none;
    }
}

/* ==========================================================================
   GRID: 4-COLUMN (stat cards on dashboard)
   ========================================================================== */

.portal-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .portal-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .portal-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   EVENTS, CLIENTS, TALENT PAGES
   ========================================================================== */

.events-page,
.clients-page,
.talent-page {
    max-width: 1400px;
}

/* -- Stat Badges (Events header) ----------------------------------------- */

.stat-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
}

.stat-badge-draft {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-badge-closed {
    background: rgba(255, 193, 7, 0.12);
    color: #d4a007;
}

.stat-badge-active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--status-success);
}

.stat-badge-past {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* -- Filter Bar ---------------------------------------------------------- */

.admin-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
}

.filter-input {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--brand-text);
    background: #fff;
    min-width: 140px;
    transition: border-color 0.15s ease;
}

.filter-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

/* -- Status Pills (Talent page) ------------------------------------------ */

.status-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-pill {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.status-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.status-pill.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.status-pill-count {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}

.status-pill.active .status-pill-count {
    background: rgba(255, 255, 255, 0.25);
}

/* -- Table Status Badges (Events) ---------------------------------------- */

.table-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-status-active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--status-success);
}

.table-status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.table-status-inactive {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.table-status-upcoming {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.table-status-open {
    background: #d4edda;
    color: #155724;
}

.table-status-closed {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.table-status-past {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.staff-count {
    font-weight: 700;
    color: var(--brand-dark);
}

.staff-breakdown {
    font-weight: 600;
    font-size: 13px;
    color: var(--brand-dark);
}
.staff-breakdown.staff-full {
    color: var(--status-success, #16a34a);
}
.staff-breakdown.staff-partial {
    color: var(--status-warning, #d97706);
}

.opp-name-link {
    color: var(--brand-dark);
    text-decoration: none;
}
.opp-name-link:hover {
    color: var(--brand-primary, #67c6b4);
    text-decoration: underline;
}

/* -- Talent Avatars ------------------------------------------------------ */

.talent-avatar-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.talent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e9ecef;
}

.talent-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), #5ab3a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.talent-name {
    font-weight: 600;
    color: var(--brand-dark);
    text-decoration: none;
}
.talent-name:hover { color: var(--brand-primary); }
a.talent-name-link {
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
}
a.talent-name-link:hover { text-decoration: underline; }

/* Completeness mini bar in Talent DataTable */
.talent-comp-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.talent-comp-bar {
    width: 48px;
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}
.talent-comp-fill {
    height: 100%;
    border-radius: 3px;
}
.talent-comp-fill.high { background: var(--status-success); }
.talent-comp-fill.medium { background: var(--status-warning); }
.talent-comp-fill.low { background: var(--status-error); }
.talent-comp-pct {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 28px;
}

/* Profile header action buttons */
.profile-header-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

/* Photo Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
    opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 40px;
    width: 48px;
    height: 64px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.15s;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.3); }
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    z-index: 10001;
}

/* Photo gallery items — clickable hover */
.photo-gallery-item {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.photo-gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Video Gallery */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.video-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.video-gallery-item iframe {
    display: block;
    border: none;
    border-radius: 8px;
}

/* Tag pills (skills, roles, industries, languages) */
.tag-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #f0faf8;
    border: 1px solid #d1ede7;
    border-radius: 4px;
    font-size: 12px;
    color: #303e48;
    margin: 0 6px 6px 0;
}

/* Additional status badges */
.table-status-warning {
    background: #fef3c7;
    color: #92400e;
}
.table-status-muted {
    background: #f3f4f6;
    color: #6b7280;
}

/* -- Health Badge Inline (Clients table) --------------------------------- */

.health-badge-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.health-badge-inline.health-badge-healthy {
    background: rgba(40, 167, 69, 0.15);
    color: var(--status-success);
}

.health-badge-inline.health-badge-at_risk {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.health-badge-inline.health-badge-critical {
    background: rgba(220, 53, 69, 0.15);
    color: var(--status-error);
}

/* -- Small Action Button ------------------------------------------------- */

/* btn-small duplicate removed — primary definition at line 67 */

/* ==========================================================================
   DATATABLES OVERRIDES (Phase 3)
   ========================================================================== */

/* DataTables top bar (search + length) */
.dt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
}

.dt-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
    color: var(--brand-text-muted);
}

/* Override DataTables default styles */
.dataTables_wrapper {
    font-family: var(--font-family);
}

.dataTables_length {
    font-size: 13px;
    color: var(--brand-text-muted);
}

.dataTables_length select {
    padding: 6px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    margin: 0 4px;
    background: #fff;
}

.dataTables_filter {
    font-size: 0;
}

.dataTables_filter input {
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    min-width: 220px;
    transition: border-color 0.15s ease;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.dataTables_info {
    font-size: 13px;
    color: var(--brand-text-muted);
}

.dataTables_paginate {
    display: flex;
    gap: 4px;
}

.dataTables_paginate .paginate_button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--brand-text-muted) !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    transition: all 0.15s ease;
    text-decoration: none !important;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--content-bg) !important;
    color: var(--brand-text) !important;
    border-color: var(--brand-primary) !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border-color: var(--brand-primary) !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: default;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: #fff !important;
    color: var(--brand-text-muted) !important;
    border-color: #e5e7eb !important;
}

/* Processing overlay */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    font-size: 14px;
    color: var(--brand-text-muted);
    padding: 20px !important;
    z-index: 10;
}

.dt-processing-spinner {
    color: var(--brand-primary);
    font-weight: 600;
}

/* Remove DataTables default border/shadow on table */
table.dataTable {
    border-collapse: collapse !important;
    margin: 0 !important;
    width: 100% !important;
}

table.dataTable thead th {
    border-bottom: 2px solid #e9ecef !important;
}

table.dataTable.no-footer {
    border-bottom: none !important;
}

/* Sort icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
    position: relative;
    padding-right: 24px !important;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--brand-text-muted);
}

table.dataTable thead .sorting::after {
    content: '\2195';
    opacity: 0.3;
}

table.dataTable thead .sorting_asc::after {
    content: '\2191';
    color: var(--brand-primary);
    opacity: 1;
}

table.dataTable thead .sorting_desc::after {
    content: '\2193';
    color: var(--brand-primary);
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE: Events / Clients / Talent
   ========================================================================== */

@media (max-width: 768px) {
    .admin-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .stat-badges {
        margin-top: 8px;
    }

    .cd-section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .dt-top,
    .dt-bottom {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

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

    .talent-avatar-cell {
        min-width: 160px;
    }

    /* Horizontal scroll for wide tables */
    .portal-card-body {
        overflow-x: auto;
    }
}


/* ==========================================================================
   DETAIL PAGES (Event Detail, Talent Detail)
   ========================================================================== */

.event-detail-page,
.talent-detail-page {
    max-width: 1400px;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand-primary);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color var(--transition-fast);
}

.detail-back-link:hover {
    color: var(--brand-primary-dark);
}

/* Detail Header (event name + status + date) */
.detail-header {
    margin-bottom: var(--space-lg);
}

.detail-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
}

.detail-header-title {
    font-family: var(--font-family-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 4px 0;
}

.detail-header-date {
    font-size: 14px;
    color: var(--brand-text-muted);
}

/* Info Grid (2 columns) */
.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.detail-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-muted);
    flex-shrink: 0;
    width: 100px;
}

.detail-info-value {
    font-size: 14px;
    color: var(--brand-dark);
    text-align: right;
}

.detail-info-value a {
    color: var(--brand-primary);
    text-decoration: none;
}

.detail-info-value a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   TALENT DETAIL: Profile Header
   ========================================================================== */

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.profile-photo-large {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    background: #e9ecef;
    flex-shrink: 0;
}

.profile-photo-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), #5ab3a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header-info {
    flex: 1;
    min-width: 0;
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.profile-header-name {
    font-family: var(--font-family-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
}

.profile-header-location {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin: 0 0 12px 0;
}

.profile-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--brand-text);
}

.profile-header-meta a {
    color: var(--brand-primary);
    text-decoration: none;
}

.profile-header-meta a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   TALENT DETAIL: Stats Row
   ========================================================================== */

.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.profile-stat-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    text-align: center;
}

.profile-stat-value {
    font-family: var(--font-family-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 4px;
}

.profile-stat-value.stat-value-success {
    color: var(--status-success);
}

.profile-stat-value.stat-value-warning {
    color: var(--status-warning);
}

.profile-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
}

/* ==========================================================================
   TALENT DETAIL: Photo Gallery
   ========================================================================== */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.photo-gallery-item {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.photo-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.photo-gallery-item:hover .photo-gallery-img {
    transform: scale(1.05);
}

/* ==========================================================================
   PAYMENTS PAGE
   ========================================================================== */

.payments-page {
    max-width: 1400px;
}

/* Summary Cards */
.payment-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.summary-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px 24px;
}

.summary-card-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-text-muted);
    margin-bottom: 8px;
}

.summary-card-value {
    font-family: var(--font-family-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-dark);
}

.summary-card-value.summary-card-success {
    color: var(--status-success);
}

.summary-card-value.summary-card-warning {
    color: #c07600;
}

/* Tab Bar */
.payment-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: var(--space-lg);
}

.payment-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-tab:hover {
    color: var(--brand-dark);
}

.payment-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

/* Payment Status Badges */
.table-status-paid    { background: #d4edda; color: #155724; }
.table-status-unpaid  { background: #f8d7da; color: #721c24; }
.table-status-partial { background: #fff3cd; color: #856404; }

/* ==========================================================================
   RESPONSIVE: Detail Pages + Payments
   ========================================================================== */

@media (max-width: 768px) {
    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .detail-header-content {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-header-top {
        justify-content: center;
    }

    .profile-header-meta {
        justify-content: center;
    }

    .profile-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .payment-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}


/* ==========================================================================
   OPPORTUNITY DETAIL PAGE
   ========================================================================== */

.opportunity-detail-page {
    max-width: 1400px;
}

/* Staff grouped by opportunity */
.opp-staff-group {
    margin-bottom: var(--space-lg);
}

.opp-staff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-dark);
}

.opp-staff-header .opp-staff-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
    color: var(--brand-text-muted);
    font-size: 13px;
}

/* Financials row (4-col grid) */
.financials-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.financial-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px 24px;
    text-align: center;
}

.financial-card-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-text-muted);
    margin-bottom: 8px;
}

.financial-card-value {
    font-family: var(--font-family-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-dark);
}

.financial-card-value.financial-positive {
    color: var(--status-success);
}

.financial-card-value.financial-negative {
    color: #dc3545;
}

/* Admin One-Sheet Viewer */
.onesheet-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: 1px solid #67c6b4;
    color: #67c6b4;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.onesheet-link:hover {
    background: #67c6b4;
    color: #fff;
}
.os-arrow {
    transition: transform 0.2s;
    margin-left: 4px;
}
.os-arrow-open {
    transform: rotate(180deg);
}
.onesheet-admin {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 40px;
}
.os-event-header {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e9ecef;
}
.os-event-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #303e48;
    margin: 0 0 6px;
}
.os-event-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}
.os-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f3f4;
}
.os-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.os-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #67c6b4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}
.os-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.os-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.os-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}
.os-value {
    font-size: 14px;
    color: #303e48;
}
.os-contact, .os-contact-row {
    padding: 8px 0;
    font-size: 14px;
}
.os-contact-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.os-contact-info { flex: 1; }
.os-contact-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.os-contact-row:hover .os-contact-actions { opacity: 1; }
.os-contact-actions .inline-edit-btn { color: #adb5bd; padding: 2px; }
.os-contact-actions .os-contact-delete-btn:hover { color: #dc3545; }
.os-contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
.os-contact-form input, .os-contact-form select {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}
.os-contact-form input:focus, .os-contact-form select:focus { border-color: #67c6b4; outline: none; }
.os-contact-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.os-primary-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #67c6b4;
    text-transform: uppercase;
    margin-left: 8px;
}
.os-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.os-checklist li {
    padding: 4px 0 4px 20px;
    position: relative;
    font-size: 14px;
}
.os-checklist li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #67c6b4;
    font-weight: 700;
}
.os-details {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin: 8px 0 0;
}
.os-material, .os-material-row {
    padding: 6px 0;
}
.os-material-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.os-material-link { flex: 1; }
.os-material a, .os-material-link a {
    color: #67c6b4;
    font-weight: 500;
    text-decoration: none;
}
.os-material a:hover, .os-material-link a:hover {
    text-decoration: underline;
}
.os-material-row .os-material-delete-btn {
    opacity: 0;
    transition: opacity 0.15s;
    color: #adb5bd;
    padding: 2px;
}
.os-material-row:hover .os-material-delete-btn { opacity: 1; }
.os-material-delete-btn:hover { color: #dc3545 !important; }
.os-materials-actions { display: inline-flex; gap: 8px; float: right; }
.os-url-form {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin: 8px 0;
}
.os-url-form input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.os-url-form input:focus { border-color: #67c6b4; outline: none; }
.os-empty-state { color: #adb5bd; font-size: 13px; font-style: italic; padding: 8px 0; margin: 0; }
.os-staff-item {
    padding: 4px 0;
    font-size: 14px;
}
.os-staff-item a {
    color: #303e48;
    font-weight: 500;
    text-decoration: none;
}
.os-staff-item a:hover {
    color: #67c6b4;
}

/* Print styles for one-sheet */
@media print {
    .sidebar, .topbar, .detail-back-link, .detail-header, .detail-info-grid,
    .financials-row, #oppStaffTable, .portal-card:not(#onesheetPanel),
    .onesheet-link, #onesheetPanel .portal-card-header button,
    .os-contact-actions, .os-materials-actions, .os-add-contact-btn,
    .os-material-delete-btn, .os-contact-form, .os-url-form,
    .os-edit-btn, .edit-field-btn, #materialFileInput { display: none !important; }
    .os-staff-item a { color: #000 !important; }
    #onesheetPanel { display: block !important; box-shadow: none !important; border: none !important; }
    .onesheet-admin { max-width: 100%; }
}

@media (max-width: 768px) {
    .onesheet-admin { padding: 20px; }
    .os-grid { grid-template-columns: 1fr; }
}

/* ICA status badges */
.ica-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ica-status-signed {
    background: #d4edda;
    color: #155724;
}

.ica-status-unsigned {
    background: #fff3cd;
    color: #856404;
}

/* Workflow step badge */
.workflow-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: #e9ecef;
    color: var(--brand-text-muted);
}

.workflow-badge.workflow-active {
    background: var(--brand-primary);
    color: #fff;
}

.workflow-badge.workflow-complete {
    background: #d4edda;
    color: #155724;
}

/* Activity Timeline */
.activity-timeline {
    padding: 0;
    margin: 0;
    list-style: none;
}

.activity-timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.activity-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

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

.activity-timeline-text {
    font-size: 14px;
    color: var(--brand-dark);
    margin-bottom: 2px;
}

.activity-timeline-time {
    font-size: 12px;
    color: var(--brand-text-muted);
}

/* Opportunity list page */
.opportunities-page {
    max-width: 1400px;
}

/* Clients table on event detail */
.clients-table {
    width: 100%;
}

/* ==========================================================================
   CLIENT DETAIL PAGE
   ========================================================================== */

.client-detail-page {
    max-width: 1400px;
}

/* Feedback entries */
.feedback-entry {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 0;
}

.feedback-entry:last-child {
    border-bottom: none;
}

.feedback-rating-large {
    font-size: 20px;
    font-weight: 700;
}

.feedback-meta {
    font-size: 13px;
    color: var(--brand-text-muted);
    margin-top: 4px;
}

.feedback-text {
    font-size: 14px;
    margin-top: 8px;
}

.feedback-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--brand-text-muted);
    margin-bottom: 4px;
}

/* NPS badges */
.nps-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.nps-promoter {
    background: #d4edda;
    color: #155724;
}

.nps-passive {
    background: #fff3cd;
    color: #856404;
}

.nps-detractor {
    background: #f8d7da;
    color: #721c24;
}

/* Primary contact badge */
.contact-primary-badge {
    display: inline-block;
    background: var(--brand-primary);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Upcoming events highlight card */
.upcoming-events-card {
    border-left: 3px solid var(--brand-primary);
    background: #f8fffe;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.upcoming-events-card h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.upcoming-events-card h3 svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Payment status in stats row */
.payment-status-good {
    color: #155724;
}

.payment-status-partial {
    color: #856404;
}

.payment-status-unpaid {
    color: #721c24;
}

/* Would book again badges */
.book-again-yes {
    color: #155724;
    font-weight: 600;
}

.book-again-no {
    color: #721c24;
    font-weight: 600;
}

.book-again-maybe {
    color: #856404;
    font-weight: 600;
}

/* Responsive for opportunity detail */
@media (max-width: 768px) {
    .financials-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .opp-staff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}


/* ==========================================================================
   GLOBAL SEARCH — Compact topbar search (Salesforce / Linear style)
   ========================================================================== */

.global-search {
    position: relative;
    width: 360px;
    max-width: 360px;
    flex-shrink: 1;
    margin: 0 auto;
}

.global-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f4f5f7;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.global-search-input-wrap:hover {
    background: #ecedf0;
}

.global-search-input-wrap:focus-within {
    background: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(103, 198, 180, 0.15);
}

.global-search-icon {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search-icon svg {
    width: 15px;
    height: 15px;
}

.global-search-input {
    width: 100%;
    padding: 7px 56px 7px 32px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--brand-dark);
    background: transparent;
    line-height: 1.4;
}

.global-search-input:focus {
    outline: none;
}

.global-search-input::placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.global-search-kbd {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #9ca3af;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Hide kbd when input has focus or has value */
.global-search-input:focus ~ .global-search-kbd,
.global-search-input:not(:placeholder-shown) ~ .global-search-kbd {
    display: none;
}

/* Dropdown */
.global-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: -60px;
    width: 480px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
}

.global-search-dropdown.open {
    display: block;
}

.global-search-group {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.global-search-group:last-child {
    border-bottom: none;
}

.global-search-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.12s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    margin: 1px 6px;
}

.global-search-item:hover,
.global-search-item.active {
    background: #f4f5f7;
    text-decoration: none;
    color: inherit;
}

.global-search-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
    border-radius: 8px;
    color: #6b7280;
    flex-shrink: 0;
}

.global-search-item:hover .global-search-item-icon,
.global-search-item.active .global-search-item-icon {
    background: #e8e9ec;
}

.global-search-item-icon svg {
    width: 16px;
    height: 16px;
}

.global-search-item-text {
    flex: 1;
    min-width: 0;
}

.global-search-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.global-search-item-meta {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 1px;
}

.global-search-see-all {
    display: block;
    padding: 5px 14px 2px;
    font-size: 12px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.global-search-see-all:hover {
    text-decoration: underline;
    color: var(--brand-primary-dark);
}

.global-search-empty {
    padding: 28px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.global-search-empty svg {
    display: block;
    margin: 0 auto 8px;
    width: 32px;
    height: 32px;
    color: #d1d5db;
}

.global-search-recent-title {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
}

/* Typing/loading indicator */
.global-search-loading {
    padding: 20px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}


/* ==========================================================================
   SAVED FILTERS
   ========================================================================== */

.saved-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.saved-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--brand-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.saved-filter-chip:hover {
    border-color: var(--brand-primary);
    background: rgba(103, 198, 180, 0.08);
}

.saved-filter-chip.active {
    border-color: var(--brand-primary);
    background: rgba(103, 198, 180, 0.12);
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.saved-filter-chip-star {
    width: 14px;
    height: 14px;
    color: var(--brand-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.saved-filter-chip-star:hover {
    color: #f5a623;
}

.saved-filter-chip-star.is-default {
    color: #f5a623;
    fill: #f5a623;
}

.saved-filter-chip-star svg {
    width: 14px;
    height: 14px;
}

.saved-filter-chip-delete {
    width: 14px;
    height: 14px;
    font-size: 16px;
    line-height: 14px;
    color: var(--brand-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
}

.saved-filter-chip-delete:hover {
    color: #dc3545;
}

.saved-filter-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: none;
    border: 1px dashed var(--border-light);
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.saved-filter-save-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Save Filter Modal (inline) */
.saved-filter-modal {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.saved-filter-modal.open {
    display: flex;
}

.saved-filter-modal-input {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    width: 180px;
}

.saved-filter-modal-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.saved-filter-modal-save {
    padding: 6px 14px;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.saved-filter-modal-save:hover {
    background: var(--brand-primary-dark);
}

.saved-filter-modal-cancel {
    padding: 6px 14px;
    background: none;
    color: var(--brand-text-muted);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.saved-filter-modal-error {
    color: #dc3545;
    font-size: 12px;
}

/* Responsive: shrink search on smaller screens */
@media (max-width: 1024px) {
    .global-search {
        width: 280px;
        max-width: 280px;
    }

    .global-search-dropdown {
        left: -40px;
        width: 400px;
    }
}

@media (max-width: 768px) {
    .global-search {
        width: auto;
        max-width: none;
        flex: 1;
        margin: 0 8px;
    }

    .global-search-kbd {
        display: none;
    }

    .global-search-input {
        padding-right: 10px;
    }

    .global-search-dropdown {
        left: 0;
        width: 100%;
        min-width: 300px;
    }
}


/* =========================================================================
   EVENT FORM — Create / Edit
   ========================================================================= */

.event-form-page {
    max-width: 900px;
}

.event-form-page .portal-card + .portal-card {
    margin-top: var(--space-lg);
}

.event-form .form-group {
    margin-bottom: var(--space-md);
}

.event-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.event-form .form-group input,
.event-form .form-group select,
.event-form .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    transition: border-color 0.15s;
}

.event-form .form-group input:focus,
.event-form .form-group select:focus,
.event-form .form-group textarea:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(103, 198, 180, 0.15);
}

.event-form .form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.event-form .form-row-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
}

/* Catalog search */
.catalog-search-wrap {
    position: relative;
}

.catalog-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-md);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.catalog-results.active {
    display: block;
}

.catalog-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.1s;
}

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

.catalog-result-item:hover,
.catalog-result-item.active {
    background-color: var(--bg-hover);
}

.catalog-result-item .catalog-item-name {
    font-weight: 600;
    font-size: 14px;
}

.catalog-result-item .catalog-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.catalog-create-new {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--brand-teal);
    border-top: 1px solid var(--border-color);
}

.catalog-create-new:hover {
    background-color: var(--bg-hover);
}

/* Date rows */
/* -- Venue Selector ----------------------------------------------------- */

.venue-selector {
    margin-bottom: 8px;
}

.venue-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.venue-selected-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--brand-teal);
}

.venue-selected-info > div {
    line-height: 1.3;
}

.venue-selected-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-dark);
}

.venue-change-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.venue-change-btn:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.venue-search-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.venue-create-inline-btn {
    background: none;
    border: none;
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-align: left;
}
.venue-create-inline-btn:hover {
    text-decoration: underline;
}

.venue-perday-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    margin-top: 12px;
}
.venue-perday-toggle label {
    font-weight: 500 !important;
    font-size: 13px !important;
    margin-bottom: 0 !important;
    color: var(--text-muted);
}

/* -- Dates Table -------------------------------------------------------- */

.dates-table {
    width: 100%;
    border-collapse: collapse;
}

.dates-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.dates-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

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

.dates-td-day {
    width: 48px;
    text-align: center;
    padding-left: 16px !important;
}

.date-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.dates-table input[type="date"],
.dates-table input[type="time"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: var(--brand-dark);
    transition: border-color 0.15s;
}
.dates-table input[type="date"]:focus,
.dates-table input[type="time"]:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(103, 198, 180, 0.12);
}

.dates-td-actions {
    width: 48px;
    text-align: center;
}

.date-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.date-remove-btn:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.dates-td-venue {
    min-width: 200px;
}
.dates-td-venue .venue-search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

.btn-add-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-date:hover {
    border-color: var(--brand-teal);
    background: rgba(103, 198, 180, 0.05);
}

/* Venue autocomplete */
.venue-autocomplete-wrap {
    position: relative;
    flex: 1;
}

.venue-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.venue-results.active {
    display: block;
}

.venue-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.1s;
}

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

.venue-result-item:hover,
.venue-result-item.active {
    background-color: var(--bg-hover);
}

.venue-result-item .venue-item-name {
    font-weight: 600;
    font-size: 13px;
}

.venue-result-item .venue-item-loc {
    font-size: 12px;
    color: var(--text-muted);
}

.venue-create-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: none;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.venue-create-btn:hover {
    background: var(--bg-hover);
}

.venue-inline-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--space-md);
    margin-top: var(--space-sm);
    display: none;
}

.venue-inline-form.active {
    display: block;
}

.venue-inline-form .form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.venue-inline-form .form-group {
    margin-bottom: var(--space-sm);
}

.venue-inline-form .form-group:last-child {
    margin-bottom: 0;
}

/* Event form actions */
.event-form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    padding: var(--space-lg) 0 0;
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-lg);
}

.event-form-actions .btn-primary {
    padding: 10px 24px;
}

.event-form-actions .btn-cancel {
    padding: 10px 24px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.event-form-actions .btn-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ==========================================================================
   OPPORTUNITY STATUS BADGES (6-5)
   Color-coded badges with friendly labels for opportunity/event statuses.
   ========================================================================== */

.opp-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.opp-status-draft {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
}

.opp-status-warning {
    background: rgba(255, 193, 7, 0.12);
    color: #d4a007;
}

.opp-status-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--status-success);
}

.opp-status-muted {
    background: rgba(148, 163, 184, 0.1);
    color: var(--brand-text-muted);
}

.opp-status-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--status-error);
}

.opp-status-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
}

.opp-status-live {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

/* -- Opportunity Alerts ------------------------------------------------- */

.opp-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.opp-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}
.opp-alert:hover {
    text-decoration: none;
}

.opp-alert-error {
    background: rgba(220, 53, 69, 0.06);
    border-left-color: #dc3545;
    color: #991b1b;
}
.opp-alert-error:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #991b1b;
}

.opp-alert-warning {
    background: rgba(217, 119, 6, 0.06);
    border-left-color: #d97706;
    color: #92400e;
}
.opp-alert-warning:hover {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
}

.opp-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.opp-alert-message {
    flex: 1;
}

.opp-alert-arrow {
    flex-shrink: 0;
    font-size: 16px;
    opacity: 0.5;
}

/* ==========================================================================
   LIFECYCLE SEGMENTED CONTROL (6-6)
   Compact inline toggle for event status (Upcoming / Open / Closed).
   ========================================================================== */

.lifecycle-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lifecycle-seg {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--brand-text-muted);
    transition: all 0.15s;
    line-height: 1.4;
}

.lifecycle-seg:first-of-type {
    border-radius: 5px 0 0 5px;
}

.lifecycle-seg:last-of-type {
    border-radius: 0 5px 5px 0;
    margin-right: 4px;
}

.lifecycle-seg:not(:first-of-type) {
    border-left: none;
}

.lifecycle-seg:hover:not(.lifecycle-seg-active):not(.lifecycle-seg-disabled) {
    background: #f8f9fa;
    color: var(--brand-dark);
}

.lifecycle-seg-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lifecycle-seg-active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.lifecycle-seg-active + .lifecycle-seg {
    border-left-color: var(--brand-dark);
}

.lifecycle-status-msg {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.lifecycle-status-msg.show {
    opacity: 1;
}

.lifecycle-status-msg.success {
    color: var(--status-success);
}

.lifecycle-status-msg.error {
    color: var(--status-error);
}

/* Image upload area */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--brand-teal);
    background: rgba(103, 198, 180, 0.03);
}

.image-upload-area.has-image {
    border-style: solid;
    padding: 0;
}

.image-upload-area .upload-placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.image-upload-area .upload-placeholder svg {
    display: block;
    margin: 0 auto 8px;
    opacity: 0.4;
}

.image-upload-area img {
    max-width: 100%;
    max-height: 200px;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

.image-upload-area .upload-change-label {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    padding: 6px;
    text-align: center;
}

.image-upload-area.has-image:hover .upload-change-label {
    display: block;
}

/* Event detail header with edit button */
.detail-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .event-form .form-row-2col,
    .event-form .form-row-3col {
        grid-template-columns: 1fr;
    }

    .dates-table thead { display: none; }
    .dates-table tbody td { display: block; padding: 4px 16px; border-bottom: none; }
    .dates-table tbody tr { border-bottom: 1px solid var(--border-light); padding: 8px 0; }
    .dates-td-day { text-align: left; }
    .dates-td-actions { text-align: left; }
}

/* Date year grouping */
.date-year-header {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 700;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.date-year-header.past-year {
    background: #f8f9fa;
    color: var(--text-muted);
}

.past-date-row td {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ==========================================================================
   INSTANCE TABS (Event Detail - multi-year/season instances)
   ========================================================================== */

.instance-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.instance-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.instance-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    text-decoration: none;
}

.instance-tab-active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: 600;
}

.instance-tab-active:hover {
    color: var(--brand-primary);
}

.instance-tab-past {
    color: var(--text-muted);
    opacity: 0.65;
}

.instance-tab-past:hover {
    opacity: 1;
}

.instance-tab .status-badge {
    font-size: 11px;
    padding: 2px 8px;
}

/* Single instance notice */
.instance-single-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Instance content sections */
.instance-content .admin-card {
    margin-bottom: 20px;
}

/* Clickable opportunity names in tables */
.opp-name-link {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.opp-name-link:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

/* Staff name links */
.staff-name-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.staff-name-link:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* Staff breakdown styling */
.staff-breakdown {
    font-weight: 500;
}

.staff-full {
    color: var(--success-color, #28a745);
}

.staff-partial {
    color: var(--warning-color, #f59e0b);
}

.staff-none {
    color: var(--text-muted);
}

/* Opportunity alerts */
.opp-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.opp-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid;
}

.opp-alert-error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.opp-alert-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.opp-alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* Live status badge */
.opp-status-live {
    background: #7c3aed;
    color: #fff;
}

@media (max-width: 768px) {
    .instance-tabs {
        gap: 0;
    }
    .instance-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
}


/* ==========================================================================
   TALENT PIPELINE (Event Detail)
   ========================================================================== */

/* Stats bar in card header */
.pipeline-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.pipeline-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand-text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: #f1f5f9;
}

.pipeline-stat-count {
    font-weight: 700;
    color: var(--brand-dark);
}

.ps-booked { background: rgba(103, 198, 180, 0.12); }
.ps-booked .pipeline-stat-count { color: #2a9d8f; }
.ps-invited { background: rgba(59, 130, 246, 0.10); }
.ps-invited .pipeline-stat-count { color: var(--status-info); }
.ps-notified { background: rgba(245, 158, 11, 0.10); }
.ps-notified .pipeline-stat-count { color: #d97706; }
.ps-available { background: rgba(107, 114, 128, 0.10); }
.ps-unavailable { background: rgba(107, 114, 128, 0.06); }
.ps-unavailable .pipeline-stat-count { color: #9ca3af; font-weight: 600; }
.ps-eligible { background: transparent; border: 1px dashed #cbd5e1; }

/* Spinner for async eligible count */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin-sm 0.6s linear infinite;
}

@keyframes spin-sm {
    to { transform: rotate(360deg); }
}

/* Filter chips row */
.pipeline-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.pipeline-chip {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.pipeline-chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-dark);
}

.pipeline-chip-active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.pipeline-chip-active:hover {
    color: #fff;
}

.pipeline-search {
    margin-left: auto;
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    width: 180px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.pipeline-search:focus {
    border-color: var(--brand-primary);
}

/* Pipeline body */
.pipeline-body {
    padding: 20px;
}

/* Group headings */
.pipeline-group {
    margin-bottom: 24px;
}

.pipeline-group:last-child {
    margin-bottom: 0;
}

.pipeline-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-text-muted);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.pipeline-group-unavailable .pipeline-group-title {
    color: #9ca3af;
    border-bottom-color: #e5e7eb;
}

/* Card grid */
.pipeline-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 10px;
}

/* Individual talent card */
.pipeline-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: var(--card-radius);
    border-left: 3px solid #dee2e6;
    background: #fff;
    transition: box-shadow var(--transition-fast);
}

.pipeline-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pipeline-card-booked  { border-left-color: var(--brand-primary); }
.pipeline-card-invited  { border-left-color: var(--status-info); }
.pipeline-card-available { border-left-color: #9ca3af; }
.pipeline-card-unavailable {
    border-left-color: #e5e7eb;
    opacity: 0.55;
}
.pipeline-card-unavailable:hover {
    box-shadow: none;
    opacity: 0.65;
}

/* Photo */
.pipeline-card-photo {
    flex-shrink: 0;
    width: 72px;
}

.pipeline-card-img {
    width: 72px;
    height: 72px;
    border-radius: var(--card-radius);
    object-fit: cover;
    display: block;
}

.pipeline-card-initials {
    width: 72px;
    height: 72px;
    border-radius: var(--card-radius);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

/* Card content */
.pipeline-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pipeline-card-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pipeline-card-name {
    font-weight: 600;
    color: var(--brand-dark);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card-name:hover {
    color: var(--brand-primary);
}

.pipeline-card-meta {
    font-size: 12px;
    color: var(--brand-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.pipeline-card-row-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.pipeline-card-rate {
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-dark);
}

/* Status pills */
.sp {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.sp-booked    { background: rgba(103, 198, 180, 0.15); color: #1a7a6d; }
.sp-invited   { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.sp-notified  { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.sp-available { background: rgba(107, 114, 128, 0.12); color: #4b5563; }
.sp-declined  { background: rgba(220, 53, 69, 0.12); color: #b91c1c; }
.sp-unavailable { background: rgba(107, 114, 128, 0.10); color: #9ca3af; }

/* Action buttons */
.pipeline-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.btn-primary-sm {
    background: var(--brand-primary);
    color: #fff;
    border: 1px solid var(--brand-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.btn-notify-sm {
    background: #fff;
    color: #6b7280;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-notify-sm:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.btn-danger-sm {
    background: #fff;
    color: var(--status-error);
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger-sm:hover {
    background: var(--status-error);
    border-color: var(--status-error);
    color: #fff;
}

.btn-danger-outline-sm {
    background: #fff;
    color: var(--status-error);
    border: 1px solid var(--status-error);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.btn-danger-outline-sm:hover {
    background: rgba(220, 53, 69, 0.08);
    border-color: #b91c1c;
    color: #b91c1c;
}

.pipeline-card-notified-label {
    font-size: 12px;
    color: #d97706;
    font-weight: 500;
    font-style: italic;
}

.pipeline-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .pipeline-cards {
        grid-template-columns: 1fr;
    }
    .pipeline-stats {
        gap: 6px;
    }
    .pipeline-stat {
        font-size: 12px;
        padding: 3px 8px;
    }
    .pipeline-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .pipeline-search {
        width: 140px;
        flex-shrink: 0;
    }
}

/* Feature 4: Notify All Eligible */
.talent-pipeline .portal-card-header {
    flex-wrap: wrap;
    gap: 8px;
}
#notifyAllEligibleBtn {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}
#notifyAllEligibleBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
#notifyAllEligibleBtn .spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* Feature 5: Refresh Availability button */
#refreshAvailBtn {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    transition: background-color 0.2s, opacity 0.2s;
}
#refreshAvailBtn:hover:not(:disabled) {
    background-color: #fffbeb;
}
#refreshAvailBtn:disabled {
    cursor: not-allowed;
}
#refreshAvailBtn .spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* Photo gallery delete button + type label */
.photo-gallery-item {
    position: relative;
}
.photo-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}
.photo-gallery-item:hover .photo-delete-btn {
    opacity: 1;
}
.photo-delete-btn:hover {
    background: #dc3545;
}
.photo-type-label {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Video badge on application cards */
.app-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    background: #f3f0ff;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.app-card-video {
    border-left: 3px solid #7c3aed;
}

/* Ready to review filter */
.app-ready-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    white-space: nowrap;
    padding: 7px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s;
}
.app-ready-filter:hover {
    border-color: #67c6b4;
}
.app-ready-filter input[type="checkbox"] {
    accent-color: #67c6b4;
}

/* Status Dropdown */
.status-dropdown-wrap {
    position: relative;
}
.status-dropdown-toggle {
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
}
.status-dropdown-toggle:hover {
    filter: brightness(0.95);
}
.status-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    min-width: 180px;
    padding: 4px;
}
/* Let status dropdown overflow the portal-card boundary */
.profile-header-top .status-dropdown-wrap {
    z-index: 100;
}
.portal-card:has(.status-dropdown-wrap) {
    overflow: visible;
}
.portal-card:has(.status-dropdown-wrap) > .portal-card-body {
    overflow: visible;
}
.status-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #303e48;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
}
.status-dropdown-item:hover:not(:disabled) {
    background: #f8f9fa;
}
.status-dropdown-item:disabled {
    cursor: default;
    opacity: 0.7;
}
.status-dropdown-item .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.table-status-active    { background: #28a745; }
.status-dot.table-status-pending   { background: #ffc107; }
.status-dot.table-status-inactive  { background: #adb5bd; }
.status-dot.table-status-warning   { background: #fd7e14; }
.status-current-label {
    margin-left: auto;
    font-size: 11px;
    color: #adb5bd;
    font-weight: 400;
}

/* Muted staff rows (unresponsive/declined/cancelled) */
.staff-row-muted {
    opacity: 0.5;
}
.staff-row-muted td {
    text-decoration: line-through;
    text-decoration-color: #adb5bd;
}
.staff-row-muted td:first-child,
.staff-row-muted td:last-child {
    text-decoration: none;
}

/* Inline edit button for needed count */
.inline-edit-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 2px;
    vertical-align: middle;
    margin-left: 4px;
}
.inline-edit-btn:hover {
    color: #67c6b4;
}

/* Inline field editing */
.inline-field-input {
    padding: 4px 8px;
    border: 1px solid #67c6b4;
    border-radius: 4px;
    font-size: 14px;
    width: 160px;
    max-width: 100%;
}
.editable-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* One-sheet edit area */
.os-edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #67c6b4;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
}
.os-edit-btn {
    vertical-align: middle;
}

/* Pipeline unresponsive cards */
.pipeline-card-unresponsive {
    opacity: 0.5;
}
.ps-unresponsive { color: #dc3545; }
.sp-unresponsive { background: #f8d7da; color: #721c24; }

/* ═══════════════════════════════════════════════════════════════
   AI ASSISTANT PANEL
   ═══════════════════════════════════════════════════════════════ */

/* Topbar toggle button */
.portal-ai-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--brand-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: background 150ms ease, color 150ms ease;
    padding: 0;
    margin-right: 4px;
}
.portal-ai-toggle svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}
.portal-ai-toggle:hover,
.portal-ai-toggle.active {
    background: rgba(103, 198, 180, 0.12);
    color: var(--brand-primary);
}

/* Panel overlay */
.ai-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 299;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}
.ai-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide-out panel */
.ai-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    background: var(--card-bg, #ffffff);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 300ms ease;
    overflow: hidden;
}
.ai-panel.open {
    transform: translateX(0);
}

/* Panel header */
.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.ai-panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-panel-icon svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    color: var(--brand-primary);
}
/* Ensure all SVGs inside the AI panel are constrained */
.ai-panel svg {
    max-width: 24px;
    max-height: 24px;
}
.ai-panel-title {
    font-family: var(--font-family-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--brand-text);
}
.ai-panel-close {
    border: none;
    background: none;
    font-size: 24px;
    color: var(--brand-text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ai-panel-close:hover {
    color: var(--brand-text);
}

/* Panel body (scrollable conversation area) */
.ai-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome message */
.ai-panel-welcome {
    text-align: center;
    color: var(--brand-text-muted);
    padding: 32px 16px;
    font-size: 14px;
    line-height: 1.6;
}
.ai-panel-welcome p {
    margin: 0 0 8px;
}
.ai-panel-welcome ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ai-panel-welcome li {
    padding: 4px 0;
}
.ai-panel-welcome li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--brand-primary);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Panel footer (input area) */
.ai-panel-footer {
    border-top: 1px solid var(--card-border);
    padding: 12px 20px 16px;
    flex-shrink: 0;
}

/* Quick action chips */
.ai-panel-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.ai-chip {
    padding: 4px 12px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--brand-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ai-chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(103, 198, 180, 0.06);
}

/* Input row */
.ai-panel-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.ai-panel-input {
    flex: 1;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-family);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color var(--transition-fast);
}
.ai-panel-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}
.ai-panel-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}
.ai-panel-send svg {
    width: 16px;
    height: 16px;
}
.ai-panel-send:hover {
    background: var(--brand-primary-dark);
}

/* ── Conversation cards ── */
.ai-card {
    animation: aiCardIn 200ms ease;
}
@keyframes aiCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-card-user .ai-card-content {
    background: rgba(103, 198, 180, 0.1);
    border: 1px solid rgba(103, 198, 180, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--brand-text);
    white-space: pre-wrap;
}

.ai-card-loading .ai-card-content {
    color: var(--brand-text-muted);
    font-size: 13px;
    padding: 8px 0;
}

.ai-card-error .ai-card-content,
.ai-card-content.ai-card-error {
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #721c24;
}

.ai-card-content.ai-card-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #155724;
}
.ai-card-success a {
    color: #155724;
    font-weight: 600;
    text-decoration: underline;
}

/* Loading dots animation */
.ai-loading-dots span {
    animation: aiDot 1.4s infinite;
    font-weight: 700;
    font-size: 18px;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot {
    0%, 20% { opacity: 0.2; }
    40%     { opacity: 1; }
    100%    { opacity: 0.2; }
}

/* ── Confirmation cards ── */
.ai-confirm-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.ai-confirm-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--brand-text);
    border-bottom: 1px solid var(--card-border);
    background: #f8f9fa;
}
.ai-confirm-body {
    padding: 12px 16px;
}
.ai-confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.ai-confirm-label {
    color: var(--brand-text-muted);
    flex-shrink: 0;
    width: 80px;
}
.ai-confirm-value {
    color: var(--brand-text);
    text-align: right;
    flex: 1;
}
.ai-confirm-desc {
    padding: 8px 0;
    font-size: 13px;
    color: var(--brand-text);
    white-space: pre-wrap;
    border-top: 1px solid var(--card-border);
    margin-top: 8px;
}
.ai-confirm-notice {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: 6px;
    font-size: 12px;
    color: #856404;
}
.ai-confirm-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fdf2f2;
    border-radius: 6px;
    font-size: 12px;
    color: #721c24;
}
.ai-confirm-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--card-border);
    background: #f8f9fa;
}
.ai-confirm-actions .btn-primary,
.ai-confirm-actions .btn-secondary,
.ai-confirm-actions .btn-muted {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}
.ai-confirm-actions .btn-primary {
    background: var(--brand-primary);
    color: #fff;
}
.ai-confirm-actions .btn-primary:hover {
    background: var(--brand-primary-dark);
}
.ai-confirm-actions .btn-secondary {
    background: var(--card-bg);
    color: var(--brand-text);
    border: 1px solid var(--card-border);
}
.ai-confirm-actions .btn-secondary:hover {
    background: #f0f0f0;
}
.ai-confirm-actions .btn-muted {
    background: none;
    color: var(--brand-text-muted);
}
.ai-confirm-actions .btn-muted:hover {
    color: var(--brand-text);
}

/* Inline edit mode in confirmation cards */
.ai-edit-mode {
    padding: 4px 0;
}
.ai-edit-field {
    margin-bottom: 8px;
}
.ai-edit-field label {
    display: block;
    font-size: 11px;
    color: var(--brand-text-muted);
    margin-bottom: 2px;
}
.ai-edit-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-family);
    box-sizing: border-box;
}
.ai-edit-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}
.ai-edit-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Date rows in edit mode */
.ai-edit-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}
.ai-edit-date-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px 24px;
    gap: 4px;
    align-items: center;
}
.ai-edit-date-row .ai-edit-input {
    padding: 5px 6px;
    font-size: 12px;
}
.ai-date-remove {
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: #dc3545;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
}
.ai-date-remove:hover {
    background: #fdf2f2;
}

/* Date rows in view mode */
.ai-date-view-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 1px 0;
}
.ai-date-view-date { color: var(--brand-text, #333); }
.ai-date-view-time { color: var(--brand-text-muted, #666); font-size: 12px; }
.ai-confirm-row-dates { align-items: flex-start; }

/* Tags in confirmation cards */
.ai-confirm-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
    vertical-align: middle;
}
.ai-tag-existing {
    background: #d4edda;
    color: #155724;
}
.ai-tag-new {
    background: #cce5ff;
    color: #004085;
}

/* ═══════════════════════════════════════════════════════════════
   NOTES PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Filter bar */
.notes-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.notes-filter-tabs {
    display: flex;
    gap: 4px;
}
.notes-filter-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--brand-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.notes-filter-tab:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--brand-text);
    text-decoration: none;
}
.notes-filter-tab.active {
    background: var(--brand-primary);
    color: #fff;
}
.notes-filter-count {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 0 5px;
    margin-left: 4px;
}
.notes-filter-tab:not(.active) .notes-filter-count {
    background: rgba(0, 0, 0, 0.06);
}

/* Type chips */
.notes-type-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.notes-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    font-size: 12px;
    color: var(--brand-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.notes-type-chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    text-decoration: none;
}
.notes-type-chip.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.notes-type-chip svg {
    width: 14px;
    height: 14px;
}

/* Notes list */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notes-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--brand-text-muted);
    background: var(--card-bg);
    border-radius: var(--card-radius);
}

/* Note card */
.note-card {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}
.note-card:hover {
    box-shadow: var(--card-shadow);
}
.note-card.expanded {
    box-shadow: var(--card-shadow-hover);
}

/* Priority stripe */
.note-card-priority {
    width: 4px;
    flex-shrink: 0;
}

/* Card body */
.note-card-body {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
}

/* Card header row */
.note-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.note-card-type {
    flex-shrink: 0;
    color: var(--brand-text-muted);
    display: flex;
}
.note-card-title {
    flex: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-card-status {
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Card description (expandable) */
.note-card-description {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--brand-text);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Card meta */
.note-card-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--brand-text-muted);
}
.note-card-page {
    background: #f0f0f0;
    padding: 1px 8px;
    border-radius: 4px;
}

/* Card actions (expandable) */
.note-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
}
.note-card-actions .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.note-card-actions .btn-success {
    background: var(--status-success);
    color: #fff;
}
.note-card-actions .btn-warning {
    background: var(--status-warning);
    color: #333;
}
.note-card-actions .btn-outline {
    background: var(--card-bg);
    color: var(--brand-text);
    border: 1px solid var(--card-border);
}
.note-card-actions .btn-muted {
    background: none;
    color: var(--brand-text-muted);
}
.note-card-actions .btn-danger {
    background: none;
    color: #dc3545;
}

/* ── Note Modal ── */
.note-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}
.note-modal {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
}
.note-modal-header h2 {
    margin: 0;
    font-size: 18px;
}
.note-modal-close {
    border: none;
    background: none;
    font-size: 24px;
    color: var(--brand-text-muted);
    cursor: pointer;
    line-height: 1;
}
.note-modal-body {
    padding: 20px;
}
.note-form-row {
    margin-bottom: 14px;
}
.note-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 4px;
}
.note-form-row input,
.note-form-row select,
.note-form-row textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family);
    box-sizing: border-box;
}
.note-form-row textarea {
    resize: vertical;
    min-height: 80px;
}
.note-form-row input:focus,
.note-form-row select:focus,
.note-form-row textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
}
.note-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.note-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--card-border);
}
.note-modal-footer .btn-primary,
.note-modal-footer .btn-secondary {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}
.note-modal-footer .btn-primary {
    background: var(--brand-primary);
    color: #fff;
}
.note-modal-footer .btn-primary:hover {
    background: var(--brand-primary-dark);
}
.note-modal-footer .btn-secondary {
    background: var(--card-bg);
    color: var(--brand-text);
    border: 1px solid var(--card-border);
}

/* ── Page header buttons ── */
.cd-page-header-right .btn-primary {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    background: var(--brand-primary);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-family);
}
.cd-page-header-right .btn-primary:hover {
    background: var(--brand-primary-dark);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ai-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .notes-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .note-form-row-2col {
        grid-template-columns: 1fr;
    }
}

/* Full-width Book button for invited pipeline cards */
.btn-book-full {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    order: -1;
}
.pipeline-card-actions:has(.btn-book-full) {
    flex-wrap: wrap;
}
.btn-secondary-sm {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-secondary-sm:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none;
}

/* ===== REDESIGNED PIPELINE CARDS (v2) ===== */

/* Card header: name+location left, rate right */
.pipeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.pipeline-card-header-left {
    min-width: 0;
    flex: 1;
}
.pipeline-card-location {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-top: 1px;
}
.pipeline-card-rate {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
    white-space: nowrap;
    flex-shrink: 0;
}

/* De-emphasize contact info */
.pipeline-card-contact {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    line-height: 1.4;
}

/* Status context bar */
.pipeline-context-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0 2px;
}
.pipeline-context-left::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.pipeline-context-right {
    font-weight: 500;
    font-size: 11px;
    white-space: nowrap;
}

/* Invited context bar — warm yellow */
.context-bar-invited {
    background: #fffbeb;
    color: #92400e;
}
.context-bar-invited .pipeline-context-left::before {
    background: #f59e0b;
}
.context-bar-invited .pipeline-context-right {
    color: #b45309;
}

/* Invited urgent — approaching 48hr timeout */
.context-bar-urgent {
    background: #fef2f2;
    color: #991b1b;
}
.context-bar-urgent .pipeline-context-left::before {
    background: #dc2626;
    animation: urgentPulse 1.5s ease-in-out infinite;
}
.context-bar-urgent .pipeline-context-right {
    color: #dc2626;
    font-weight: 700;
}
@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Available context bar — subtle green */
.context-bar-available {
    background: #ecfdf5;
    color: #065f46;
}
.context-bar-available .pipeline-context-left::before {
    background: #10b981;
}

/* Booked context bar — subtle teal */
.context-bar-booked {
    background: rgba(103, 198, 180, 0.1);
    color: #1a7a6d;
}
.context-bar-booked .pipeline-context-left::before {
    background: #67c6b4;
}
.context-bar-booked .pipeline-context-right {
    color: #4b5563;
}

/* Action buttons — all horizontal on one row */
.pipeline-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

/* Pipeline card button base */
.pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

/* Primary — teal filled */
.pc-btn-primary {
    background: #67c6b4;
    color: #fff;
    border: none;
}
.pc-btn-primary:hover {
    background: #4db3a0;
    color: #fff;
    text-decoration: none;
}

/* Secondary — outline */
.pc-btn-secondary {
    background: transparent;
    color: #303e48;
    border: 1.5px solid #e2e8f0;
}
.pc-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    text-decoration: none;
}

/* Destructive — red outline, pushed right */
.pc-btn-destructive {
    background: transparent;
    color: #dc3545;
    border: 1.5px solid #f5c6cb;
    margin-left: auto;
}
.pc-btn-destructive:hover {
    background: rgba(220, 53, 69, 0.06);
    border-color: #dc3545;
    color: #b91c1c;
}

/* Remove old rate positioning that conflicts */
.pipeline-card-row-bottom {
    display: none;
}

/* =========================================
   REFUND SYSTEM
   ========================================= */

/* Refund ledger (payment & refunds section) */
.refund-ledger { font-size: 14px; }
.refund-ledger-row {
    display: flex;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 8px;
}
.refund-ledger-row:last-child { border-bottom: none; }
.refund-ledger-label { font-weight: 500; min-width: 140px; }
.refund-ledger-meta { flex: 1; color: #6b7280; font-size: 13px; }
.refund-ledger-amount { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 100px; text-align: right; }
.refund-ledger-refund { background: #fef2f2; margin: 4px -16px; padding: 10px 16px; border-radius: 6px; border-bottom: none; }
.refund-ledger-refund .refund-amount { color: #dc2626; }
.refund-ledger-net { border-top: 2px solid #111827; padding-top: 12px; margin-top: 4px; }
.refund-ledger-net .refund-ledger-label { font-size: 15px; }
.refund-ledger-net .refund-ledger-amount { font-size: 16px; }
.refund-ledger-detail { display: flex; gap: 16px; padding: 4px 0 8px 0; font-size: 12px; color: #9ca3af; flex-wrap: wrap; }
.refund-ledger-note { font-size: 12px; color: #6b7280; font-style: italic; padding: 0 0 8px 0; margin-top: -6px; }

/* Refund status badges */
.refund-status-succeeded { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.refund-status-failed { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.refund-status-pending { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }

/* Refund modal */
.refund-policy-box { padding: 12px 16px; background: #f9fafb; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.refund-models-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.refund-model-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f9fafb; border-radius: 6px; cursor: pointer; font-size: 14px; }
.refund-model-item:hover { background: #f3f4f6; }
.refund-model-item input[type="checkbox"] { width: 16px; height: 16px; }
/* Stacked per-model breakdown */
.refund-model-breakdown { background: #f9fafb; border-radius: 6px; padding: 12px 16px; margin-bottom: 8px; }
.refund-model-breakdown-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #111827; }
.refund-model-breakdown-lines { font-size: 13px; }
.rb-line { display: flex; justify-content: space-between; padding: 2px 0; color: #4b5563; }
.rb-line span:last-child { font-variant-numeric: tabular-nums; }
.rb-line-total { border-top: 1px solid #d1d5db; margin-top: 4px; padding-top: 4px; font-weight: 600; color: #111827; }
.refund-grand-total { border-top: 2px solid #111827; margin-top: 8px; padding-top: 8px; font-size: 14px; }
.refund-grand-total .rb-line-total { border-top: none; margin-top: 0; padding-top: 0; font-size: 15px; }
.refund-override-input { width: 200px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 14px; }

@media (max-width: 640px) {
    #refundModal .modal-content { max-width: 95vw !important; }
}
.refund-override-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
