/**
 * Fantasy Draft Board v4.0 - Roster Management Modal Styles
 * @version 4.200
 * 
 * REDESIGN: Full-screen 2-column layout based on v3 prototype
 * - Left Panel (40%): Roster + Free Agents tabs
 * - Right Panel (60%): Queued Moves + Waiver Groups tabs
 * - Header: Capacity meters, FAAB/salary display
 * - Footer: Warning banners + Execute bar
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

.roster-mgmt-modal-overlay {
    /* Colors - inherit from app or define fallbacks */
    --rm-bg-primary: var(--bg-primary, #121212);
    --rm-bg-secondary: var(--bg-secondary, #1e1e1e);
    --rm-bg-tertiary: var(--bg-tertiary, #2d2d2d);
    --rm-bg-elevated: var(--bg-elevated, #383838);
    --rm-text-primary: var(--text-primary, #ffffff);
    --rm-text-secondary: var(--text-secondary, #a0a0a0);
    --rm-text-muted: var(--text-muted, #707070);
    --rm-border-color: var(--border-color, #3d3d3d);
    --rm-accent: var(--accent-color, #4CAF50);
    --rm-accent-hover: #43a047;
    
    /* Semantic colors */
    --rm-success: #4CAF50;
    --rm-warning: #FFC107;
    --rm-danger: #ef5350;
    --rm-info: #2196F3;
    
    /* Position colors */
    --rm-pos-qb: #e91e63;
    --rm-pos-rb: #4caf50;
    --rm-pos-wr: #2196f3;
    --rm-pos-te: #ff9800;
    --rm-pos-k: #9c27b0;
    --rm-pos-def: #795548;
    --rm-pos-idp: #607d8b;
    
    /* Spacing */
    --rm-gap-sm: 0.5rem;
    --rm-gap-md: 1rem;
    --rm-gap-lg: 1.5rem;
    
    /* Sizing */
    --rm-header-height: 70px;
    --rm-footer-height: 70px;
    --rm-panel-tab-height: 44px;
}

/* ============================================
   MODAL OVERLAY - FULL SCREEN
   ============================================ */

.roster-mgmt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

/* ============================================
   MODAL CONTAINER - FULL SCREEN
   ============================================ */

.roster-mgmt-modal-content {
    background: var(--rm-bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* ============================================
   HEADER - CAPACITY METERS & CONTROLS
   ============================================ */

.roster-mgmt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--rm-bg-tertiary);
    border-bottom: 1px solid var(--rm-border-color);
    min-height: var(--rm-header-height);
    flex-shrink: 0;
}

.rm-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rm-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rm-header-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rm-text-primary);
}

.rm-team-name {
    font-size: 0.875rem;
    color: var(--rm-text-secondary);
}

/* Capacity Meters Container */
.rm-header-center {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Individual Capacity Meter */
.rm-capacity-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 80px;
}

.rm-capacity-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rm-text-muted);
}

.rm-capacity-bar {
    width: 100%;
    height: 6px;
    background: var(--rm-bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.rm-capacity-fill {
    height: 100%;
    background: var(--rm-accent);
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.rm-capacity-fill.warning {
    background: var(--rm-warning);
}

.rm-capacity-fill.danger {
    background: var(--rm-danger);
}

.rm-capacity-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rm-text-primary);
}

/* FAAB / Salary Display */
.rm-budget-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-left: 1.5rem;
    border-left: 1px solid var(--rm-border-color);
}

.rm-budget-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rm-text-muted);
}

.rm-budget-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--rm-success);
}

.rm-budget-amount.low {
    color: var(--rm-warning);
}

.rm-budget-amount.critical {
    color: var(--rm-danger);
}

.rm-budget-worst-case {
    font-size: 0.75rem;
    color: var(--rm-text-muted);
}

/* Header Right - Close Button */
.rm-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.roster-mgmt-close-btn {
    background: transparent;
    border: none;
    color: var(--rm-text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.roster-mgmt-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rm-text-primary);
}

/* ============================================
   MAIN BODY - 2-COLUMN GRID
   ============================================ */

.roster-mgmt-modal-body {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(300px, 2fr) minmax(400px, 3fr);
    gap: 0;
    overflow: hidden;
    min-height: 0; /* Important for nested scrolling */
}

/* ============================================
   LEFT PANEL - ROSTER & FREE AGENTS
   ============================================ */

.rm-left-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--rm-border-color);
    background: var(--rm-bg-secondary);
    overflow: hidden;
}

/* Panel Tabs */
.rm-panel-tabs {
    display: flex;
    background: var(--rm-bg-tertiary);
    border-bottom: 1px solid var(--rm-border-color);
    height: var(--rm-panel-tab-height);
    flex-shrink: 0;
}

.rm-panel-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--rm-text-secondary);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rm-panel-tab:hover {
    color: var(--rm-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.rm-panel-tab.active {
    color: var(--rm-accent);
    border-bottom-color: var(--rm-accent);
    background: rgba(76, 175, 80, 0.1);
}

.rm-panel-tab-icon {
    font-size: 1rem;
}

.rm-panel-tab-count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--rm-bg-elevated);
    border-radius: 10px;
    color: var(--rm-text-secondary);
}

.rm-panel-tab.active .rm-panel-tab-count {
    background: var(--rm-accent);
    color: white;
}

/* Panel Content Area */
.rm-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--rm-gap-md);
}

.rm-tab-pane {
    display: none;
}

.rm-tab-pane.active {
    display: block;
}

/* ============================================
   RIGHT PANEL - MOVES & WAIVERS
   ============================================ */

.rm-right-panel {
    display: flex;
    flex-direction: column;
    background: var(--rm-bg-primary);
    overflow: hidden;
}

/* Panel toggle button for mobile */
.rm-panel-toggle {
    display: none;
    margin-left: auto;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.rm-panel-toggle:hover {
    color: var(--rm-accent-color);
}

@media (max-width: 768px) {
    .rm-panel-toggle {
        display: flex;
        align-items: center;
    }
    
    .rm-right-minimized .rm-panel-toggle .toggle-icon {
        transform: rotate(180deg);
    }
    
    .rm-right-expanded .rm-panel-toggle .toggle-icon::before {
        content: '✕';
    }
    
    .rm-right-expanded .rm-panel-toggle .toggle-icon {
        font-size: 1.1rem;
    }
}

/* ============================================
   SEARCH & FILTER BAR
   ============================================ */

.rm-filter-bar {
    display: flex;
    gap: var(--rm-gap-sm);
    padding: var(--rm-gap-sm) var(--rm-gap-md);
    background: var(--rm-bg-tertiary);
    border-bottom: 1px solid var(--rm-border-color);
}

.rm-search-input {
    flex: 1;
    background: var(--rm-bg-primary);
    border: 1px solid var(--rm-border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    padding-left: 2rem;
    color: var(--rm-text-primary);
    font-size: 0.875rem;
}

.rm-search-input:focus {
    outline: none;
    border-color: var(--rm-accent);
}

.rm-search-wrapper {
    display: flex;
    position: relative;
    align-items: center;
}

.rm-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rm-text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.rm-pos-filter {
    background: var(--rm-bg-primary);
    border: 1px solid var(--rm-border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--rm-text-primary);
    font-size: 0.875rem;
    min-width: 100px;
    cursor: pointer;
}

.rm-pos-filter:focus {
    outline: none;
    border-color: var(--rm-accent);
}

/* Filter dropdowns row */
.rm-filter-dropdowns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rm-team-filter,
.rm-injury-filter {
    background: var(--rm-input-bg, #2a2a2a);
    color: var(--rm-text, #e0e0e0);
    border: 1px solid var(--rm-border, #444);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.8em;
    cursor: pointer;
    max-width: 120px;
}

/* Clickable player name for profile */
.rm-profile-link {
    cursor: pointer;
    transition: color 0.15s;
}
.rm-profile-link:hover {
    color: var(--rm-accent, #4fc3f7);
    text-decoration: underline;
}

/* Bye week display */
.rm-player-bye {
    font-size: 0.75em;
    color: #888;
    margin-left: 4px;
}

/* Muted IR/Taxi slot indicator */
.rm-badge-slot {
    background: #555;
    color: #aaa;
    font-size: 0.7em;
    font-style: italic;
}

/* ============================================
   FRANCHISE PICKER OVERLAY
   ============================================ */

/* Full overlay covering the modal body */
.rm-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.rm-picker-container {
    background: var(--rm-panel-bg, #1e1e1e);
    border: 1px solid var(--rm-border, #444);
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.rm-picker-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--rm-border, #444);
}

.rm-picker-header h3 {
    margin: 0 0 4px;
    color: var(--rm-text, #e0e0e0);
    font-size: 1.2em;
}

.rm-picker-subtitle {
    margin: 0;
    color: #888;
    font-size: 0.85em;
}

/* Scrollable franchise list */
.rm-picker-list {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}

/* Individual franchise row */
.rm-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.rm-picker-row:hover {
    background: rgba(79, 195, 247, 0.12);
}

.rm-picker-row.rm-picker-current {
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

/* Team icon */
.rm-picker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rm-picker-icon-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #333;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: bold;
    flex-shrink: 0;
}

.rm-picker-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.rm-picker-team-name {
    color: var(--rm-text, #e0e0e0);
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rm-picker-owner {
    color: #888;
    font-size: 0.8em;
}

.rm-picker-no-owner {
    color: #666;
    font-style: italic;
}

.rm-picker-current-badge {
    font-size: 0.7em;
    color: var(--rm-accent, #4fc3f7);
    background: rgba(79, 195, 247, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Save preference radio buttons */
.rm-picker-save-options {
    padding: 12px 24px 16px;
    border-top: 1px solid var(--rm-border, #444);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rm-picker-save-label {
    color: #aaa;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-picker-save-label input[type="radio"] {
    accent-color: var(--rm-accent, #4fc3f7);
}

/* Cancel button for switch mode */
.rm-picker-cancel-btn {
    margin: 0 24px 16px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
}

.rm-picker-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Switch franchise button in header */
.rm-switch-franchise-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.8em;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.rm-switch-franchise-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rm-accent, #4fc3f7);
}

/* Ensure modal body is positioned for the overlay */
.roster-mgmt-modal-body {
    position: relative;
}

/* ============================================
   ROSTER SECTIONS (Starters, Bench, IR, Taxi)
   ============================================ */

.rm-roster-section {
    margin-bottom: var(--rm-gap-lg);
}

.rm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--rm-border-color);
}

.rm-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rm-text-primary);
    margin: 0;
}

.rm-section-icon {
    font-size: 1rem;
}

.rm-section-count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--rm-bg-elevated);
    border-radius: 10px;
    color: var(--rm-text-secondary);
    font-weight: 500;
}

/* Collapsible sections */
.rm-section-toggle {
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: transform 0.2s;
}

.rm-section-toggle.collapsed {
    transform: rotate(-90deg);
}

.rm-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rm-section-content.collapsed {
    max-height: 0 !important;
}

/* ============================================
   PLAYER ROWS
   ============================================ */

.rm-player-list {
    border: 1px solid var(--rm-border-color);
    border-radius: 8px;
    background: var(--rm-bg-primary);
    overflow: hidden;
}

.rm-player-row {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--rm-border-color);
    transition: background 0.15s;
    cursor: pointer;
}

.rm-player-row:last-child {
    border-bottom: none;
}

.rm-player-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rm-player-row.selected {
    background: rgba(76, 175, 80, 0.15);
    border-left: 3px solid var(--rm-accent);
    padding-left: calc(0.75rem - 3px);
}

.rm-player-row.staged {
    background: rgba(76, 175, 80, 0.1);
}

.rm-player-row.staged-drop {
    background: rgba(239, 83, 80, 0.1);
}

/* Player Position Badge */
.rm-player-pos {
    min-width: 36px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    color: white;
    margin-right: 0.75rem;
}

.rm-player-pos.pos-qb { background: var(--rm-pos-qb); }
.rm-player-pos.pos-rb { background: var(--rm-pos-rb); }
.rm-player-pos.pos-wr { background: var(--rm-pos-wr); }
.rm-player-pos.pos-te { background: var(--rm-pos-te); }
.rm-player-pos.pos-k { background: var(--rm-pos-k); }
.rm-player-pos.pos-def { background: var(--rm-pos-def); }
.rm-player-pos.pos-dl,
.rm-player-pos.pos-lb,
.rm-player-pos.pos-db,
.rm-player-pos.pos-de,
.rm-player-pos.pos-dt,
.rm-player-pos.pos-cb,
.rm-player-pos.pos-s,
.rm-player-pos.pos-ed { background: var(--rm-pos-idp); }

/* Player Info */
.rm-player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0; /* Allow text truncation */
}

.rm-player-name {
    font-weight: 500;
    color: var(--rm-text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rm-player-details {
    font-size: 0.75rem;
    color: var(--rm-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-player-team {
    font-weight: 500;
}

/* Player Status Badges */
.rm-player-badges {
    display: flex;
    gap: 0.375rem;
    margin-left: 0.5rem;
}

.rm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Injury Badges */
.rm-badge-ir,
.rm-badge-out,
.rm-badge-o {
    background: #c62828;
    color: white;
}

.rm-badge-questionable,
.rm-badge-q {
    background: #f9a825;
    color: #1a1a1a;
}

.rm-badge-doubtful,
.rm-badge-d {
    background: #e65100;
    color: white;
}

.rm-badge-probable,
.rm-badge-p {
    background: #2e7d32;
    color: white;
}

/* Roster Status Badges */
.rm-badge-taxi {
    background: #7c4dff;
    color: white;
}

.rm-badge-injured-reserve {
    background: #c62828;
    color: white;
}

/* Salary/Contract Display */
.rm-player-salary {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rm-success);
    margin-left: auto;
    padding-left: 0.5rem;
}

/* Player Actions */
.rm-player-actions {
    display: flex;
    gap: 0.375rem;
    margin-left: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s;
    min-width: 140px;  /* ADD: Fixed width to accommodate up to 2 buttons */
    justify-content: flex-end;  /* ADD: Align buttons to the right within container */
}

.rm-player-row:hover .rm-player-actions {
    opacity: 1;
}

.rm-action-btn {
    background: var(--rm-bg-elevated);
    border: 1px solid var(--rm-border-color);
    color: var(--rm-text-primary);
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.rm-action-btn:hover {
    background: var(--rm-accent);
    border-color: var(--rm-accent);
    color: white;
}

.rm-action-btn.action-ir:hover {
    background: var(--rm-info);
    border-color: var(--rm-info);
}

.rm-action-btn.action-drop:hover {
    background: var(--rm-danger);
    border-color: var(--rm-danger);
}

.rm-action-btn.action-staged {
    background: var(--rm-accent);
    border-color: var(--rm-accent);
    color: white;
}

/* ============================================
   QUEUED MOVES LIST
   ============================================ */

.rm-moves-queue {
    margin-bottom: var(--rm-gap-lg);
}

.rm-move-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--rm-bg-secondary);
    border: 1px solid var(--rm-border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.rm-move-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.rm-move-icon.move-ir {
    background: rgba(33, 150, 243, 0.2);
    color: var(--rm-info);
}

.rm-move-icon.move-taxi {
    background: rgba(124, 77, 255, 0.2);
    color: #7c4dff;
}

.rm-move-icon.move-drop {
    background: rgba(239, 83, 80, 0.2);
    color: var(--rm-danger);
}

.rm-move-icon.move-add {
    background: rgba(76, 175, 80, 0.2);
    color: var(--rm-success);
}

.rm-move-info {
    flex: 1;
}

.rm-move-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rm-text-muted);
    margin-bottom: 0.125rem;
}

.rm-move-player {
    font-weight: 500;
    color: var(--rm-text-primary);
    font-size: 0.9rem;
}

.rm-move-remove {
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.rm-move-remove:hover {
    background: rgba(239, 83, 80, 0.2);
    color: var(--rm-danger);
}

/* ============================================
   WAIVER GROUPS
   ============================================ */

.rm-waiver-groups {
    display: flex;
    flex-direction: column;
    gap: var(--rm-gap-md);
}

.rm-waiver-group {
    background: var(--rm-bg-secondary);
    border: 1px solid var(--rm-border-color);
    border-radius: 8px;
    overflow: hidden;
}

.rm-group-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--rm-bg-tertiary);
    border-bottom: 1px solid var(--rm-border-color);
}

.rm-group-drag-handle {
    color: var(--rm-text-muted);
    margin-right: 0.75rem;
    cursor: grab;
    font-size: 1rem;
}

.rm-group-title {
    flex: 1;
    font-weight: 600;
    color: var(--rm-text-primary);
    font-size: 0.9rem;
}

.rm-group-count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--rm-bg-primary);
    border-radius: 10px;
    color: var(--rm-text-secondary);
    margin-right: 0.75rem;
}

.rm-group-actions {
    display: flex;
    gap: 0.25rem;
}

.rm-group-btn {
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.rm-group-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rm-text-primary);
}

.rm-group-btn.danger:hover {
    background: rgba(239, 83, 80, 0.2);
    color: var(--rm-danger);
}

/* Group Drop Player (shared across all claims in group) */
.rm-group-drop {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(239, 83, 80, 0.1);
    border-bottom: 1px solid var(--rm-border-color);
    font-size: 0.8rem;
}

.rm-group-drop-label {
    color: var(--rm-danger);
    margin-right: 0.5rem;
    font-weight: 500;
}

.rm-group-drop-player {
    color: var(--rm-text-primary);
}

.rm-group-drop-select {
    margin-left: auto;
    background: var(--rm-bg-primary);
    border: 1px solid var(--rm-border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: var(--rm-text-primary);
    font-size: 0.75rem;
    cursor: pointer;
}

/* Waiver Claims List */
.rm-waiver-claims {
    padding: 0.5rem;
}

.rm-waiver-claim {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--rm-border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--rm-bg-primary);
    cursor: grab;
}

.rm-waiver-claim:last-child {
    margin-bottom: 0;
}

.rm-waiver-claim.dragging {
    opacity: 0.5;
    border-color: var(--rm-accent);
}

.rm-claim-priority {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rm-bg-elevated);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rm-accent);
    margin-right: 0.75rem;
}

.rm-claim-reorder {
    display: flex;
    flex-direction: column;
    margin-right: 0.5rem;
}

.rm-reorder-btn {
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
}

.rm-reorder-btn:hover {
    color: var(--rm-text-primary);
}

.rm-reorder-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rm-claim-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.rm-claim-add {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-claim-add-label {
    font-size: 0.7rem;
    color: var(--rm-success);
    font-weight: 600;
}

.rm-claim-player {
    font-weight: 500;
    color: var(--rm-text-primary);
    font-size: 0.875rem;
}

.rm-claim-drop {
    font-size: 0.75rem;
    color: var(--rm-danger);
}

.rm-claim-bid {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rm-warning);
    margin-left: auto;
    padding: 0 0.75rem;
}

.rm-claim-remove {
    background: transparent;
    border: none;
    color: var(--rm-text-muted);
    cursor: pointer;
    padding: 0.375rem;
    font-size: 1rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.rm-claim-remove:hover {
    background: rgba(239, 83, 80, 0.2);
    color: var(--rm-danger);
}

/* Add Claim Button */
.rm-add-claim-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 2px dashed var(--rm-border-color);
    border-radius: 8px;
    color: var(--rm-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rm-add-claim-btn:hover {
    border-color: var(--rm-accent);
    color: var(--rm-accent);
    background: rgba(76, 175, 80, 0.05);
}

/* ============================================
   WARNING BANNERS
   ============================================ */

.rm-warnings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: var(--rm-gap-md);
    padding-top: 0;
}

.rm-warning-banner {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.rm-warning-banner.warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--rm-warning);
}

.rm-warning-banner.error {
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: var(--rm-danger);
}

.rm-warning-banner.info {
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: var(--rm-info);
}

.rm-warning-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.rm-warning-text {
    flex: 1;
}

.rm-warning-dismiss {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.rm-warning-dismiss:hover {
    opacity: 1;
}

/* ============================================
   MODAL FOOTER - EXECUTE BAR
   ============================================ */

.roster-mgmt-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--rm-bg-tertiary);
    border-top: 1px solid var(--rm-border-color);
    min-height: var(--rm-footer-height);
    flex-shrink: 0;
}

.rm-footer-left {
    display: flex;
    align-items: center;
    gap: var(--rm-gap-md);
}

.rm-staged-summary {
    font-size: 0.875rem;
    color: var(--rm-text-secondary);
}

.rm-summary-count {
    font-weight: 600;
    color: var(--rm-accent);
}

.rm-clear-all-btn {
    background: transparent;
    border: 1px solid var(--rm-border-color);
    color: var(--rm-text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.rm-clear-all-btn:hover {
    border-color: var(--rm-danger);
    color: var(--rm-danger);
    background: rgba(239, 83, 80, 0.1);
}

.rm-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rm-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rm-btn-secondary {
    background: var(--rm-bg-primary);
    color: var(--rm-text-primary);
    border: 1px solid var(--rm-border-color);
}

.rm-btn-secondary:hover:not(:disabled) {
    background: var(--rm-bg-secondary);
    border-color: var(--rm-text-secondary);
}

.rm-btn-primary {
    background: var(--rm-accent);
    color: white;
}

.rm-btn-primary:hover:not(:disabled) {
    background: var(--rm-accent-hover);
}

.rm-btn-primary.executing {
    background: var(--rm-accent);
    opacity: 0.8;
}

.rm-execute-icon {
    font-size: 1.1rem;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.rm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--rm-text-muted);
}

.rm-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.rm-empty-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--rm-text-secondary);
    margin-bottom: 0.5rem;
}

.rm-empty-text {
    font-size: 0.875rem;
    max-width: 300px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.rm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--rm-text-secondary);
}

.rm-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--rm-border-color);
    border-top-color: var(--rm-accent);
    border-radius: 50%;
    animation: rm-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* ============================================
   CONFIRMATION DIALOG
   ============================================ */

.rm-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.rm-confirm-dialog {
    background: var(--rm-bg-secondary);
    border: 1px solid var(--rm-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rm-confirm-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rm-text-primary);
    margin-bottom: 0.75rem;
}

.rm-confirm-message {
    font-size: 0.9rem;
    color: var(--rm-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.rm-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   LEAGUE RULE BADGES
   ============================================ */

.rm-rule-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.rm-rule-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--rm-bg-elevated);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--rm-text-secondary);
}

.rm-rule-badge-icon {
    font-size: 0.8rem;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.rm-panel-content::-webkit-scrollbar,
.rm-player-list::-webkit-scrollbar {
    width: 8px;
}

.rm-panel-content::-webkit-scrollbar-track,
.rm-player-list::-webkit-scrollbar-track {
    background: var(--rm-bg-primary);
}

.rm-panel-content::-webkit-scrollbar-thumb,
.rm-player-list::-webkit-scrollbar-thumb {
    background: var(--rm-bg-elevated);
    border-radius: 4px;
}

.rm-panel-content::-webkit-scrollbar-thumb:hover,
.rm-player-list::-webkit-scrollbar-thumb:hover {
    background: var(--rm-text-muted);
}

/* ============================================
   TABLET RESPONSIVE (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
    .roster-mgmt-modal-body {
        grid-template-columns: 1fr 1fr;
    }
    
    .rm-header-center {
        gap: 1rem;
    }
    
    .rm-capacity-meter {
        min-width: 60px;
    }
    
    .rm-budget-display {
        padding-left: 1rem;
    }
}

/* ============================================
   MOBILE RESPONSIVE (≤768px)
   ============================================ */

@media (max-width: 768px) {
    .roster-mgmt-modal-overlay {
        padding: 0;
    }
    
    .roster-mgmt-modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
    
    /* Stack panels vertically - 2/3 roster, 1/3 moves/waivers */
    .roster-mgmt-modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: 2fr 1fr;
    }
    
    /* Minimized state for right panel - just show tabs */
    .roster-mgmt-modal-body.rm-right-minimized {
        grid-template-rows: 1fr auto;
    }
    
    .rm-right-minimized .rm-right-panel {
        max-height: 48px;
        overflow: hidden;
    }
    
    /* Expanded state for right panel - full screen */
    .roster-mgmt-modal-body.rm-right-expanded {
        grid-template-rows: 0fr 1fr;
    }
    
    .rm-right-expanded .rm-left-panel {
        display: none;
    }
    
    .rm-left-panel {
        border-right: none;
        border-bottom: 2px solid var(--rm-border-color);
    }
    
    /* Compact header */
    .roster-mgmt-modal-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .rm-header-left {
        flex: 1;
        min-width: 150px;
    }
    
    .rm-header-center {
        order: 3;
        width: 100%;
        justify-content: space-around;
        padding-top: 0.5rem;
        border-top: 1px solid var(--rm-border-color);
    }
    
    .rm-budget-display {
        border-left: none;
        padding-left: 0;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
    
    /* Compact capacity meters */
    .rm-capacity-meter {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
    }
    
    .rm-capacity-bar {
        width: 50px;
    }
    
    /* Footer stacking */
    .roster-mgmt-modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .rm-footer-left,
    .rm-footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .rm-footer-right {
        flex-direction: column;
    }
    
    .rm-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Always show player actions on mobile */
    .rm-player-actions {
        opacity: 1;
    }
}

/* ============================================
   SMALL MOBILE (≤480px)
   ============================================ */

@media (max-width: 480px) {
    .rm-header-title h2 {
        font-size: 1rem;
    }
    
    .rm-panel-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .rm-panel-tab-count {
        display: none;
    }
    
    .rm-section-title {
        font-size: 0.8rem;
    }
    
    .rm-player-name {
        font-size: 0.85rem;
    }
    
    .rm-player-details {
        font-size: 0.7rem;
    }
    
    .rm-action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .rm-waiver-claim {
        padding: 0.5rem;
    }
    
    .rm-claim-player {
        font-size: 0.8rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .roster-mgmt-modal-body {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
    
    .rm-left-panel {
        border-right: 1px solid var(--rm-border-color);
        border-bottom: none;
    }
    
    .roster-mgmt-modal-header {
        min-height: auto;
        padding: 0.5rem 1rem;
    }
    
    .rm-header-center {
        order: 0;
        width: auto;
        border-top: none;
        padding-top: 0;
    }
    
    .roster-mgmt-modal-footer {
        min-height: auto;
        flex-direction: row;
        padding: 0.5rem 1rem;
    }
    
    .rm-footer-right {
        flex-direction: row;
    }
    
    .rm-btn {
        width: auto;
    }
}

/* ============================================
   LIGHT THEME SUPPORT
   ============================================ */

body.light-theme .roster-mgmt-modal-overlay {
    --rm-bg-primary: var(--bg-light-primary, #ffffff);
    --rm-bg-secondary: var(--bg-light-secondary, #f5f5f5);
    --rm-bg-tertiary: var(--bg-light-tertiary, #e8e8e8);
    --rm-bg-elevated: var(--bg-light-elevated, #d0d0d0);
    --rm-text-primary: var(--text-light-primary, #1a1a1a);
    --rm-text-secondary: var(--text-light-secondary, #4a4a4a);
    --rm-text-muted: var(--text-light-muted, #808080);
    --rm-border-color: var(--border-light-color, #d0d0d0);
}

/* ============================================
   DRAG AND DROP STATES
   ============================================ */

.rm-dragging {
    cursor: grabbing !important;
}

.rm-drop-target {
    outline: 2px dashed var(--rm-accent);
    outline-offset: -2px;
    background: rgba(76, 175, 80, 0.1);
}

.rm-drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    opacity: 0.9;
    transform: rotate(2deg);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes rm-slide-in {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes rm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rm-move-item {
    animation: rm-slide-in 0.2s ease-out;
}

.rm-warning-banner {
    animation: rm-slide-in 0.3s ease-out;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .roster-mgmt-modal-overlay {
        display: none;
    }
}
