.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--brand-purple); color: white; }
.btn--primary:hover { background: #7C3AED; box-shadow: var(--shadow-glow-purple); }

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

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

.btn--danger { background: var(--accent-red); color: white; }
.btn--danger:hover { background: #DC2626; }

.btn--icon { padding: 8px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.btn--icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn--sm { padding: 4px 10px; font-size: var(--text-xs); }
.btn--lg { padding: 12px 24px; font-size: var(--text-base); }

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

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--brand-purple);
    outline: none;
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-tertiary); }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 100px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge--active   { background: rgba(16, 185, 129, 0.15);  color: var(--status-active); }
.badge--onleave  { background: rgba(245, 158, 11, 0.15);  color: var(--status-onleave); }
.badge--inactive { background: rgba(107, 114, 128, 0.15); color: var(--status-inactive); }
.badge--pending  { background: rgba(59, 130, 246, 0.15);  color: var(--status-pending); }

.badge--editor    { background: rgba(139, 92, 246, 0.15);  color: var(--role-editor); }
.badge--thumbnail { background: rgba(6, 182, 212, 0.15);   color: var(--role-thumbnail); }
.badge--animator  { background: rgba(217, 70, 239, 0.15);  color: var(--role-animator); }
.badge--writer    { background: rgba(245, 158, 11, 0.15);  color: var(--role-writer); }
.badge--manager   { background: rgba(16, 185, 129, 0.15);  color: var(--role-manager); }
.badge--voiceover { background: rgba(59, 130, 246, 0.15);  color: var(--role-voiceover); }

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.card--hover { cursor: pointer; transition: all var(--transition-fast); }
.card--hover:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--xl { width: 48px; height: 48px; font-size: 16px; }
.avatar--2xl { width: 64px; height: 64px; font-size: 22px; }

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--text-tertiary);
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto var(--space-md); opacity: 0.5; }
.empty-state__title { font-size: var(--text-lg); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.empty-state__desc { font-size: var(--text-sm); margin-bottom: var(--space-lg); }

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

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

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    animation: toastIn 0.3s ease;
    max-width: 380px;
}

.toast--success { border-left: 3px solid var(--accent-green); }
.toast--error   { border-left: 3px solid var(--accent-red); }
.toast--info    { border-left: 3px solid var(--brand-purple); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: var(--space-lg);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.modal__title { font-size: var(--text-lg); font-weight: 700; }
.modal__body { padding: var(--space-lg); }

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.app-switcher { position: relative; }

.app-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.app-switcher__trigger:hover { background: var(--bg-tertiary); }
.app-switcher__trigger svg { width: 12px; height: 12px; color: var(--text-tertiary); }

.app-switcher__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs);
    z-index: 200;
}

.app-switcher__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.app-switcher__item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.app-switcher__item--active { color: var(--brand-purple); font-weight: 600; }
.app-switcher__item-check { color: var(--brand-purple); font-size: var(--text-xs); }

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-card__label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
.stat-card__value { font-size: var(--text-3xl); font-weight: 800; }

.stat-card__trend {
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card__trend--up { color: var(--accent-green); }
.stat-card__trend--down { color: var(--accent-red); }

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

.data-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-md);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-tertiary); }
.data-table tr { cursor: pointer; transition: background var(--transition-fast); }

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover { border-color: var(--brand-purple); color: var(--text-primary); }

.filter-chip--active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--brand-purple);
    border-color: var(--brand-purple);
}

.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
