/* v18.0 Strategy Scheduler Admin */

/* Status bar */
.ss-status-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: var(--brand-bg-secondary, #16213e);
    border: 1px solid var(--brand-border, #333);
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ss-status-item {
    color: var(--brand-text-primary, #eee);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ss-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ss-dot-green { background: #22c55e; }
.ss-dot-red { background: #ef4444; }

.ss-btn-health,
.ss-btn-refresh {
    margin-left: auto;
    background: var(--brand-bg-primary, #1a1a2e);
    color: var(--brand-text-primary, #eee);
    border: 1px solid var(--brand-border, #333);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ss-btn-health { margin-left: auto; }
.ss-btn-refresh { margin-left: 0; }

.ss-btn-health:hover,
.ss-btn-refresh:hover {
    border-color: var(--brand-accent, #6366f1);
}

/* Table */
.ss-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--brand-text-primary, #eee);
}

.ss-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--brand-border, #333);
    color: var(--brand-text-secondary, #888);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ss-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--brand-border, #333);
    white-space: nowrap;
}

.ss-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.ss-table code {
    background: var(--brand-bg-secondary, #16213e);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.ss-table-compact th,
.ss-table-compact td {
    padding: 8px 10px;
}

/* Badges */
.ss-badge-active {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.ss-badge-inactive {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.ss-badge-paused {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    margin-left: 4px;
}

.ss-badge-success {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.ss-badge-error {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ss-badge-running {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.ss-badge-orphan {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ss-row-orphan {
    opacity: 0.7;
    background: rgba(239, 68, 68, 0.05);
}

.ss-btn-cleanup {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
}
.ss-btn-cleanup:hover {
    background: #b91c1c;
}

/* Action buttons */
.ss-actions {
    display: flex;
    gap: 6px;
}

.ss-btn-trigger {
    background: var(--brand-accent, #6366f1);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ss-btn-trigger:hover { opacity: 0.85; }

.ss-btn-history {
    background: none;
    color: var(--brand-accent, #6366f1);
    border: 1px solid var(--brand-accent, #6366f1);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ss-btn-history:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Diff colors */
.ss-diff-add { color: #22c55e; }
.ss-diff-remove { color: #ef4444; }
.ss-error-cell {
    color: var(--brand-text-secondary, #888);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* History modal */
.ss-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ss-history-modal {
    background: var(--brand-bg-primary, #1a1a2e);
    border: 1px solid var(--brand-border, #333);
    border-radius: 12px;
    width: 700px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.ss-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--brand-border, #333);
}

.ss-history-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--brand-text-primary, #eee);
}

.ss-history-close {
    background: none;
    border: none;
    color: var(--brand-text-secondary, #888);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.ss-history-close:hover {
    color: var(--brand-text-primary, #eee);
}

.ss-history-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Health cards */
.ss-health-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.ss-health-card {
    background: var(--brand-bg-secondary, #16213e);
    border: 1px solid var(--brand-border, #333);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.ss-health-label {
    font-size: 12px;
    color: var(--brand-text-secondary, #888);
    margin-bottom: 6px;
}

.ss-health-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-text-primary, #eee);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* User filter cards */
.ss-user-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ss-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--brand-bg-secondary, #16213e);
    border: 1px solid var(--brand-border, #333);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-width: 140px;
    flex-shrink: 0;
}

.ss-user-card:hover {
    border-color: var(--brand-accent, #6366f1);
}

.ss-user-card-active {
    border-color: var(--brand-accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.ss-user-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-accent, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.ss-user-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ss-user-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-primary, #eee);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-user-card-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--brand-text-secondary, #888);
}

.ss-user-card-active-count {
    color: #22c55e;
}

/* Empty / Error */
.ss-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--brand-text-secondary, #888);
    font-size: 14px;
}

.ss-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
    font-size: 14px;
}
